Constructor and Description |
---|
Person(java.lang.String name,
int yearOfBirth)
Create a person with given name and age.
|
Modifier and Type | Method and Description |
---|---|
Address |
getAddress()
Return the address of this person.
|
java.lang.String |
getName()
Return the name of this person.
|
int |
getYearOfBirth()
Return the birth year of this person.
|
void |
setAddress(java.lang.String street,
java.lang.String town,
java.lang.String postCode)
Set a new address for this person.
|
void |
setName(java.lang.String newName)
Set a new name for this person.
|
void |
setYearOfBirth(int newYearOfBirth)
Set a new birth year for this person.
|
java.lang.String |
toString()
Return a string representation of this object.
|
Person(java.lang.String name, int yearOfBirth)
public Address getAddress()
public java.lang.String getName()
public int getYearOfBirth()
public void setAddress(java.lang.String street, java.lang.String town, java.lang.String postCode)
public void setName(java.lang.String newName)
public void setYearOfBirth(int newYearOfBirth)
public java.lang.String toString()
toString
in class java.lang.Object