单项选择题
class Thread2 implements Runnable {
void run() {
System.out.print("go ");
}
public static void main(String [] args) {
Thread2 t2 = new Thread2();
Thread t = new Thread(t2);
t.start();
}
}
结果为()
A.go
B.编译失败
C.代码运行,无输出结果
D.运行时异常被抛出
点击查看答案&解析
相关考题
-
单项选择题
以下哪项不是Swing容器?()
A.JFrame
B.JApplet
C.JDialog
D.以上皆是 -
单项选择题
class Output { public static void main(String [] args) { int i = 4; System.out.print("3" + i + " "); System.out.print(i + 4 + "6"); System.out.println(i + "7"); } } 结果为()
A.7 8611
B.7 44647
C.34 8611
D.34 8647 -
单项选择题
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.输出不可预期
