01: /**
02:    Describes a mailing address.
03: */
04: public class Address
05: {  
06:    /**
07:       Constructs a mailing address. 
08:       @param aName the recipient name
09:       @param aStreet the street
10:       @param aCity the city
11:       @param aState the two-letter state code
12:       @param aZip the ZIP postal code
13:    */
14:    public Address(String aName, String aStreet,
15:          String aCity, String aState, String aZip)
16:    {  
17:       name = aName;
18:       street = aStreet;
19:       city = aCity;
20:       state = aState;
21:       zip = aZip;
22:    }   
23: 
24:    /**
25:       Formats the address.
26:       @return the address as a string with three lines
27:    */
28:    public String format()
29:    {  
30:       return name + "\n" + street + "\n"
31:             + city + ", " + state + " " + zip;
32:    }
33:    
34:    private String name;
35:    private String street;
36:    private String city;
37:    private String state;
38:    private String zip;
39: }
40: