package com.ufe01;
public class People {
//私有化成员变量
private String name;
private int age;
//提供set/get方法
public void setName(String name){
this.name=name;
}
public String getName(){
return name;
}
public void setAge(int age){
this.age=age;
}
public int getAge(){
return age;
}
//提供有参无参构造
public People(){}
public People(String name,int age){
this.name=name;
this.age=age;
}
//提供方法
public void eat(){
System.out.println("人类爱吃饭");
}
public void sleep(){
System.out.println("人类爱睡觉");
}
}