package Zuoye;
public class Demo {
String name;
int age; //私有属性,只能在当前类中调用
int weight;
public Demo(){
}
public Demo(String name,int age,int weight){
this.name = name;
this.age = age;
this.weight = weight;
}
public void eat(){
System.out.println("吃奥利给");
}
public void play(){
System.out.println("玩奥利给");
}
public void show(){
System.out.println("name:" +this.name);
System.out.println("age:" +this.age);
System.out.println("weight:" +this.weight);
}
public static void main(String[] args){
Deno demo = new Demo();
demo.name = "精神顺";
demo.age = 18;
demo.weight = 130;
demo.show();
}
}