Question 21 (4 points) In Java, implement a class Address. An address has a house number, a street, an optional apartmen
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Question 21 (4 points) In Java, implement a class Address. An address has a house number, a street, an optional apartmen
Question 21 (4 points) In Java, implement a class Address. An address has a house number, a street, an optional apartment number, a city, a state, and a postal code. Supply two constructors: one with an apartment number and one without. Supply a print method that prints the address with the street on one line and the city, state, and zip code on the next line. boolean Supply a method public comesBefore(Address other) that tests whether this address comes before another when the addresses are compared by postal code. Then, add code that runs your implementation to show that it works. (HINT: Test this "live", including the testing, before uploading your answer here!)