输出的年龄一直为零为什么 (年龄:0狗具有吃东西的能力)
package com.imooc;
public class Initial {
public static void main(String[] args) {
// TODO Auto-generated method stub
Dog d=new Dog();
d.name="xiaotian";
d.eat();
d.age=2;
}
}
package com.imooc;
public class Initial {
public static void main(String[] args) {
// TODO Auto-generated method stub
Dog d=new Dog();
d.name="xiaotian";
d.eat();
d.age=2;
}
}
2016-03-05
举报