forked from Denisolt/CSCI-160
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPerson.java
More file actions
32 lines (27 loc) · 775 Bytes
/
Person.java
File metadata and controls
32 lines (27 loc) · 775 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
/**Defines a person by name and address*/
public class Person
{
/**The person's last name*/
private String lastName;
/**The person's first name*/
private String firstName;
/**The person's address*/
private Address home;
/**Constructor creates a person from a last name,
first name, and address
@param last the person's last name
@param first the person's first name
@param residence the person's address*/
public Person(String last, String first, Address residence)
{
lastName = last;
firstName = first;
home = residence;
}
/**toString method returns information about the person
@return information about the person*/
public String toString()
{
return(firstName + " " + lastName + ", " + home.toString());
}
}