Supply a print function that prints the address with the


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 function that prints the address with the street on one line and the city, state, and postal code on the next line. Supply a method compareTo that tests whether one address comes before another when the addresses are compared by postal code.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Supply a print function that prints the address with the
Reference No:- TGS01547226

Now Priced at $20 (50% Discount)

Recommended (94%)

Rated (4.6/5)