单项选择题
class Wrench {
public static void main(String [] args) {
Wrench w = new Wrench(); Wrench w2 = new Wrench();
w2 = go(w,w2);
System.out.print(w2 == w);
}
static Wrench go(Wrench wr1, Wrench wr2) {
Wrench wr3 = wr1; wr1 = wr2; wr2 = wr3;
return wr3;
}
}
结果是什么?()
A.true
B.false
C.编译失败
D.输出不可预期
点击查看答案&解析
相关考题
-
单项选择题
class Passer { static final int x = 5; public static void main(String [] args) { new Passer().go(x); System.out.print(x); } void go(int x) { System.out.print(++x); } } 结果是什么?()
A.55
B.56
C.65
D.66 -
单项选择题
class Beta { public static void main(String [] args) { Integer x = new Integer(6) * 7; if (x != 42) { System.out.print("42 "); } else if (x 〈 new Integer(44-1)) { System.out.println("less"); } else { System.out.print("done"); } } } 结果是什么?()
A.less
B.42
C.done
D.编译失败 -
单项选择题
假设有字符串“123”,能把该字符串变成整数的方法是哪几项?()
A.Integer.parseInt(”123”)
B.Float.parseFloat(“123”)
C.Integer.valueOf(“123”).initValue()
D.以上都不是
