按照视频做的,用的是myeclipse,然后Cat中未重写,为什么提示Animal.obj3 cannot be resolved obj3 cannot be resolved
package imooc;
public class Initial {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Animal obj1=new Animal();
Animal obj2=new Dog();
Animal.obj3=new Cat();//报错
obj1.eat();
obj2.eat();
obj3.eat();//报错
}
}
HansonQ
相关分类