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.

  1. Create the following a private instance variables:
    1. street1 as a String
    2. street2 as a String - default to null.
    3. city as a String
    4. stateCodeas a String
    5. zipCode5 as an int.
  2. Generate the Getters and Setters for these items as public methods
  3. Create a toString method for this class.
  4. Create a UnitTest class for the class created in step 1.
    1. Create an instance of the class created in step 1.
    2. Call each of the setters and pass it a value.
    3. Display the result of the toString method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!