-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAddress.java
35 lines (30 loc) · 922 Bytes
/
Address.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**Defines an address using a street, city, state, and zipcode*/
public class Address
{
/**The street number and street name*/
private String street;
/**The city in which the address is located*/
private String city;
/**The state in which the address is located*/
private String state;
/**The zip code associated with that city and street*/
private String zip;
/**Constructor creates an address using four parameters
@param road describes the street number and name
@param town describes the city
@param st describes the state
@param zipCode describes the zip code*/
public Address(String road, String town, String st, String zipCode)
{
street = road;
city = town;
state = st;
zip = zipCode;
}
/**toString method returns information about the address
@return all imformation about the address*/
public String toString()
{
return (street + ", " + city + ", " + state + " " + zip);
}
}