当前位置:SCJP程序员认证考试题库

问题:

[单选]

public class Threads4 { 
public static void main (String[] args) { 
new Threads4().go(); 
} 
public void go() { 
Runnable r = new Runnable() {
public void run() { 
System.out.print(”foo”); 
} 
}; 
Thread t = new Thread(r); 
t.start(); 
t.start(); 
} 
} 
What is the result?() 

A .  Compilation fails.
B .  An exception is thrown at runtime.
C .  The code executes normally and prints „foo”.
D .  The code executes normally, but nothing is printed.

导生制 依次填入下列各句横线处的词语,最恰当的一组是___。真正重理的人,决不应轻文;___,真正重文的人,也决不应轻理。___志趣不同,在某一方面一般地认真学习,而在另一方面特别多下功夫学习,这种情形是自然现象。___,“重”一样,“轻”一样,是不正常的思想和心理的反映()。 相反;由于;因此;却。 同样;由于;但是;却。 同样;可是;但是;只。 相反;可是;因此;只。 古算中的“韩信点兵”就是现代数学中的() 一次同余式组解法。 二次同余式组解法。 三次同余式组解法。 高次同余式组解法。 在标记符号方面《中图法》基本上采用(),只有()、()、()等比较灵活的标记方法。 防止钢铁生锈有很多方法,但使用得最多的是()。 放置暖库。 放置室外。 在钢铁表面涂刷防锈涂层。 烘干。

public class Threads4 { 
public static void main (String[] args) { 
new Threads4().go(); 
} 
public void go() { 
Runnable r = new Runnable() {
public void run() { 
System.out.print(”foo”); 
} 
}; 
Thread t = new Thread(r); 
t.start(); 
t.start(); 
} 
} 
What is the result?() 

参考答案:

  参考解析

本题暂无解析

在线 客服