挑错题:A、B、C、D注释标注的哪行代码有错误?abstract class AAA {final static void speakHello() {} //Afinal abstract void cry(); //Bstatic final int f(){ return 0 ;} //Cabstract float g(); //D}
A
B
C
D
挑错题:A、B、C、D注释标注的哪行代码有错误?abstract class Animal {int m =100;}class Dog extends Animal{double m;}public class E {public static void main(String args[]){Animal animal = null; //ADog dog = new Dog();animal = dog; //Bdog.m = 3.14; //Canimal.m = 3.14; //D}}
A
B
C
D
阅读程序题(给出下列【代码】注释标注的代码的输出结果)class A {int f(int x,int y) {return x+y;}}class B extends A {int f(int x,int y) {int m = super.f(x,y)+10;return m;}}public class E {public static void main(String args[]) {A a = new B();System.out.println(a.f(2,10)); // 【代码】}}
阅读程序题(给出下列【代码】注释标注的代码的输出结果)class Animal {int m = 100;public int seeM(){return m;}public int getM(){return m;}}class Dog extends Animal{int m = 6;public int seeM(){return m;}}public class E {public static void main(String args[]){Animal animal = null;Dog dog = new Dog();animal = dog;System.out.printf("%d:%d:%d",dog.seeM(),animal.seeM(),animal.getM()); //【代码】}}