Create a class named Person that includes fields for last name, first name, and zip code. Include a default constructor that initialize last name, first name and zip code to ‘X’ if no arguments are supplied. Also include a display method, displayPerson() to display Person details. Create a test class (main class) called TestPerson where your main() is located. In main(), instantiate and display two Person objects: one that uses default values, and one for which you supply your own values.
Jump to Post
I suggest you start by writing pseudo code. Then ...create a class named person.
All 5 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.