|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectPerson
public class Person
| Field Summary | |
|---|---|
private int |
health
The person's health |
private boolean |
isAlive
Is the person alive? If yes, the value is true. |
private java.lang.String |
name
The person's name |
| Constructor Summary | |
|---|---|
Person(java.lang.String name)
Specific constructor |
|
| Method Summary | |
|---|---|
void |
changeHealth(int byHowMuch)
Changes the health of the person by the amount specified. |
int |
getHealth()
|
boolean |
getIsAlive()
|
java.lang.String |
getName()
|
void |
setHealth(int health)
|
void |
setIsAlive(boolean isAlive)
|
void |
setName(java.lang.String name)
|
java.lang.String |
toString()
Print method for Person |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String name
private int health
private boolean isAlive
| Constructor Detail |
|---|
public Person(java.lang.String name)
name - The name to initialize for the person| Method Detail |
|---|
public int getHealth()
public void setHealth(int health)
health - The health to set.public boolean getIsAlive()
public void setIsAlive(boolean isAlive)
isAlive - The isAlive to set.public java.lang.String getName()
public void setName(java.lang.String name)
name - The name to set.public void changeHealth(int byHowMuch)
byHowMuch - How much to change the Person's health bypublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||