单项选择题
class Wrench2 {
int size;
public static void main(String [] args) {
Wrench2 w = new Wrench2();
w.size = 9;
Wrench2 w2 = go(w, w.size);
System.out.print(w2.size);
}
static Wrench2 go(Wrench2 wr, int s) {
s = 7;
return wr;
}
}
结果为:()
A.7
B.9
C.编译失败
D.输出结果不可预料
点击查看答案&解析
相关考题
-
单项选择题
class Test4 { public static void main(String [] args) { boolean x = true; boolean y = false; short z = 42; if((z++ = = 42) && (y = true)) z++; if((x = false) || (++z = = 45)) z++; System.out.println("z = " + z); } } 结果为:()
A.z = 42
B.z = 44
C.z = 45
D.z = 46 -
单项选择题
java.awt.event.MouseAdaptor是一个:()
A.接口
B.具体类
C.抽象类
D.内部类 -
单项选择题
class TestApp{ public static void main(String[] args){ int x = 5; switch(x){ case 1: case 2: case 3: System.out.println(“一季度”); break; case 4: case 5: case 6: System.out.println(“二季度”); case 7: case 8: case 9: System.out.println(“三季度”); break; ase 10: case 11: ase 12: System.out.println(“四季度”); break; default: System.out.println(“不是有效的月份”); } } } 上述程序运行后的结果是哪项?()
A.一季度
B.二季度
C.三季度
D.四季度
