挑错题:下列ABCD注释标注的哪行代码有错误?public class People {int m = 10,n; //An = 200; //Bvoid f(){if(m == n)n =+ m; //Celsen = n - m; //D}}
A
B
C
D
挑错题:下列ABCD注释标注的哪行代码有错误?class E {int x;public void f(int n) {int m; //Aint t = x+n; //Bint y = x+m; //Cm = 10;y = x+m; //D}}
A
B
C
D
挑错题:下列ABCD注释标注的哪行代码有错误?class Tom {int x;static int y;void showXY(){System.out.printf("%d,%d\n",x,y);}static void showY() {System.out.printf("%d\n",y);}}public class E {public static void main(String aqgs[]){Tom.y = 100; //ATom cat = new Tom();cat.x = 100;cat.y = 200; //BTom.x = 300; //Ccat.showXY();Tom.showY(); //D}}
A
B
C
D
阅读程序题(给出【代码】注释标注的代码的输出结果)class Fish {int weight = 1;}class Lake {Fish fish;void setFish(Fish s){fish = s;}void foodFish(int m) {fish.weight=fish.weight+m;}Fish getFish(){fish.weight -= 10;return fish;}}public class E {public static void main(String args[]) {Fish redFish = new Fish();Lake lake = new Lake();lake.setFish(redFish);lake.foodFish(120);int w = lake.fish.weight;Fish fishOK = lake.getFish();System.out.printf("%d:%d:%d",w,lake.fish.weight,fishOK.weight); //【代码】}}