为什么提示Animal.obj3 cannot be resolved obj3 cannot be resolved

按照视频做的,用的是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();//报错

}


}


Fracisco
浏览 1194回答 1
1回答

HansonQ

Animal.obj3=new Cat();//报错有个点是怎么回事
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java