Question: 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
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. Supply a method public boolean comesBefore(Address other) that tests whether this address comes before another when the addresses are compared by postal code.
Step by Step Solution
3.41 Rating (154 Votes )
There are 3 Steps involved in it
Addressjava public class Address private int houseNumber private String street private in... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
2106_61d6ac3466d6e_873057.pdf
180 KBs PDF File
2106_61d6ac3466d6e_873057.docx
120 KBs Word File
