Question: Build a class called ferson.java. This class should have the following properties: firstName, lastName, address and email. The address property should use the Address class
Build a class called ferson.java. This class should have the following properties: firstName, lastName, address and email. The address property should use the Address class that you built in Lab #1. Also add the appropriate set and get methods, display method, toString method and main method. Main() should be used to test this class. Also add 2 constructors to the Person class. One that takes no arguments and initializes the data to all 0's and "" (empty strings). And one constructor that takes all arguments. Lastly in the main() method instantiate a Person object by calling the constructor that takes all 4 arguments, then call the display method to display the data. Main Testing Code Rightarrow Person p1; p1 = new Person("James", "Jones", new Address("123 Main St.", "Dallas", "TX", 56565), "jj@yahoo.com"); p1.display()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
