可学答题网 > 问答 > SCJP程序员认证考试题库
目录: 标题| 题干| 答案| 搜索| 相关
问题

Given that a static&en


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();  

  • ACode block a.
  • BCode block B.
  • CCode block c.
  • DCode block d.
  • ECode block e.
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、若a=5,b=3,c=4,逻辑表达式!(a+b)&;&;!c的值

若a=5,b=3,c=4,逻辑表达式!(a+b)&;&;!c的值为()A0B-1C1D2

2、Given:   11. static&en

Given:  11. static class A {  12. void process() throws Exception { throw new Exce...

3、现有int a,*b;,b=&a;,则下列运算错误的是

现有int a,*b;,b=&a;,则下列运算错误的是A*&aB&*aC*&bD&*b

4、若有定义语句:double a,+P=&;a;以下叙述中错误的是( )

若有定义语句:double a,+P=&a;以下叙述中错误的是( )。A定义语句中的*号是一个问址运算符B定义语句中的*号是一个说明符C定义语句中的P只能存放double类型变量的地址...

5、Given a method that&en

Given a method that must ensure that its parameter is not null:What, inserted at line 12...

6、Given a method that&en

Given a method that must ensure that its parameter is not null:11. public void someMethod(Obj...