/**
* A Human demonstrates some attributes and methods of Humans.
*/
public class Human
{
// instance variables
private String name;
private int age;
private String phone;
private String gender;
private boolean sleep;
/**
* Constructors for objects of class Human
*/
public Human()
{
}
public Human(String genderIn)
{
gender = genderIn;
}
public Human(String genderIn, String nameIn)
{
public
gender = genderIn;
name = nameIn;
}
/**
* Methods for objects of class Human
*/
public void setAge(int ageIn){
age = ageIn;
}
public int getAge(){
return age;
}
public void birthday(){
age++;
}
public String getName() {
return name;
}
/**
* goToSleep()
*/
public void goToSleep()
{
sleep = true;
}
/**
* wakeUp()
*/
public void wakeUp()
{
sleep = false;
}
/**
* getSleepStatus()
* @return true if asleep else false
*/
public boolean getSleepStatus(){
return sleep;
}
}
给GPA加一些attribute, 一个为numberOfClassesMissed, 另一个自定,Add setters and getters for those attributes,可能不可以再麻烦加一下注释?谢谢!
慕的地8271018