按照视频做的,用的是myeclipse,然后Cat中未重写,为什么提示Animal.obj3 cannot be resolved obj3 cannot be resolvedpackage imooc;public class Initial { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stubAnimal obj1=new Animal();Animal obj2=new Dog();Animal.obj3=new Cat();//报错obj1.eat();obj2.eat();obj3.eat();//报错 }}
添加回答
举报
0/150
提交
取消