题目内容

下列【1】、【2】、【3】、【4】注释标注的哪行代码有错误?abstract class AAA {final static void speakHello() {}//【1】final abstract void cry();//【2】static final int f(){ return 0 ;}//【3】abstract float g();//【4】}

A. 【1】
B. 【2】
C. 【3】
D. 【4】

查看答案
更多问题

下列【1】、【2】、【3】、【4】注释标注的哪行代码有错误?class Father {private int money =12;float height;int seeMoney(){return money ;//【1】}}class Son extends Father {int height;int lookMoney() {int m = seeMoney();//【2】return m;}}class E {public static void main(String args[]) {Son erzi = new Son();erzi.money = 300;//【3】erzi.height = 1.78F;//【4】}}

A. 【1】
B. 【2】
C. 【3】
D. 【4】

给出下列【代码】注释标注的代码的输出结果。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 = 9;public int get(int n){return n+m;}public int see(int n){return n+m;}}class Dog extends Animal {int m = 18;public int get(int n){return n+m;}}public class E {public static void main(String args[]){Animal animal = null;Dog dog = new Dog();animal = dog;animal.m = 19;dog.m = 88;int result1 =animal.see(10);int result2 =animal.get(10);System.out.printf("%d:%d",result1,result2); //【代码】}}

给出下列【代码】注释标注的代码的输出结果。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()); //【代码】}}

答案查题题库