-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathAddress.java
More file actions
42 lines (39 loc) · 949 Bytes
/
Address.java
File metadata and controls
42 lines (39 loc) · 949 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
/**
* Class Address - used to store address details for a post address
*
* @author Michael Kölling
* @version 1.0, January 1999
*/
public class Address
{
private String street;
private String town;
private String postCode;
private String country;
/**
* Construct an Address without country
*/
public Address(String street, String town, String postCode)
{
this(street, town, postCode, "");
}
/**
* Construct an Address with full details
*/
public Address(String street, String town, String postCode, String country)
{
this.street = street;
this.town = town;
this.postCode = postCode;
this.country = country;
}
/**
* Return a string representation of this object.
*/
public String toString()
{
return street + "\n" +
town + " " + postCode + "\n" +
country + "\n";
}
}