试题详情
- 单项选择题 Given that a static method doIt() in a class Work represents work to be done, what block of code will succeed in starting a new thread that will do the work? CODE BLOCK a: Runnable r = new Runnable() { public void run() { Work.doIt(); } }; Thread t = new Thread(r); t.start(); CODE BLOCK b: Thread t = new Thread() { public void start() { Work.doIt(); } }; t.start(); CODE BLOCK c: Runnable r = new Runnable() { public void run() { Work.doIt(); } }; r.start(); CODE BLOCK d: Thread t = new Thread(new Work()); t.start(); CODE BLOCK e: Runnable t = new Runnable() { public void run() { Work.doIt(); } }; t.run();
A、Code block a.
B、Code block B.
C、Code block c.
D、Code block d.
E、Code block e.
- A
关注下方微信公众号,在线模考后查看
热门试题
- 如果a,b是引用类型的变量,且赋值表达式
- 11.public class Cou
- Your web
- public abstrac
- 类的成员有几种访问控制级?()
- 现有两个文件:A &ensp
- 求s=1+3+5+7+...直到s>20
- 11. public&ens
- 设计一个汽车类Multiplicatio
- 为将数组myArray的长度由6改为1
- Your web
- A developer&en
- 1) class̳
- float f[][][]&
- continue只能出现在在循环语句中(
- 对10个数进行排序
- 菲波那契(Fibonacci)数列的第一
- 现有: class&ens
- Less Test{&ens
- Which expressi