Question: *Create a class in Java to be used for storing all the items for an Address. Assign a name of your choosing. Create the following
*Create a class in Java to be used for storing all the items for an Address. Assign a name of your choosing.
- Create the following a private instance variables:
- street1 as a String
- street2 as a String - default to null.
- city as a String
- stateCodeas a String
- zipCode5 as an int.
- Generate the Getters and Setters for these items as public methods
- Create a toString method for this class.
- Create a UnitTest class for the class created in step 1.
- Create an instance of the class created in step 1.
- Call each of the setters and pass it a value.
- Display the result of the toString method.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
