面向对象Dog(一)

package Demo1;

public class Demo {
private String name = "大白";
private int health = 100;//健康
private int love = 0;//亲密度
private String strain = "拉布拉多犬";
//狗方法
public void Dog(){
System.out.println("我的自白:\n我叫"+this.name+"  健康状况:"+this.health+"  亲密度:"+this.love+"  品种:"+this.strain);
}
}

猜你喜欢

转载自blog.csdn.net/yehaotianyhy/article/details/79403187
今日推荐