public class person {
private String name;
private String gender ;
private int age;
private String nationaltily;
public person() {
}
public person(String name, String gender, int age, String nationaltily) {
this.name = name;
this.gender = gender;
this.age = age;
this.nationaltily = nationaltily;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getNationaltily() {
return nationaltily;
}
public void setNationaltily(String nationaltily) {
this.nationaltily = nationaltily;
}
public void eat(){
System.out.println("吃饭");
}public void sleep(){
System.out.println("睡觉");
}public void work(){
System.out.println("工作");
}
}
|
|