-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddress.java
More file actions
48 lines (39 loc) · 966 Bytes
/
Address.java
File metadata and controls
48 lines (39 loc) · 966 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
package code;
public class Address {
private String street;
private String city;
private String state;
private String zip;
//Constructors
public Address(String street, String city, String state, String zip) {
this.street = street;
this.city = city;
this.state = state;
this.zip = zip;
}
//Getters
public String getStreet() {
return street;
}
public String getCity() {
return city;
}
public String getState() {
return state;
}
public String getZip() {
return zip;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder("Address: ");
builder.append(street);
builder.append(", ");
builder.append(city);
builder.append(", ");
builder.append(state);
builder.append(", ");
builder.append(zip);
return builder.toString();
}
}