Testintface.java:30: cannot resolve symbol
symbol : method Alpha1 ()
location: class Testintface
Animal ll= Alpha1().get("meat eater");//.soundOff();
^
1 error
---------看到了么?
改成
Animal ll=new Alpha1().get("meat eater");
ll.soundOff();
symbol : method Alpha1 ()
location: class Testintface
Animal ll= Alpha1().get("meat eater");//.soundOff();
^
1 error
---------看到了么?
改成
Animal ll=new Alpha1().get("meat eater");
ll.soundOff();
其实这样改也行:
Animal ll = Alpha1.get("meat eater");
ll.soundOff();
static Animal get( String choice ) {