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

1 Expert Approved Answer
Step: 1 Unlock

Addressjava public class Address private int houseNumber private String street private in... View full answer

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

Document Format (2 attachments)

PDF file Icon

2106_61d6ac3466d6e_873057.pdf

180 KBs PDF File

Word file Icon

2106_61d6ac3466d6e_873057.docx

120 KBs Word File

Students Have Also Explored These Related Java Concepts Late Objects Questions!