【单选题】class Super { public int i=0; public Super(String text) { i=1; } } public class Sub extends Super { public Sub(String text) { i=2; } public static void main(String args[]) { Sub sub=new Sub("Helio"); ...
【简答题】public class Super { public int foo() { //do something here return 10; } } class Sub extends Super { @Override public int foo() { return _______1_____.foo()*20;//调用被覆盖的超类的foo()方法 } }
【判断题】public class Super { private String name; public Super(String name) { this.name = name; } public String getName() { return name; } } class Sub extends Super { } Sub编译会出错
【简答题】public class Super { private String name; public Super(String name) { this.name = name; } public String getName() { return name; } } class Sub extends Super { public Sub(String name) { ______1_______(...
【单选题】在JAVA中,以下程序的输出结果是() public class Super(){ public void print(){ System.out.println("Super--->print"); } public Test extends class Super(){ public void print(){ System.out.println("Test--->print"); } p...