单选题t 是一个合法的 Thread 对象的引用,并且 t 的合法 run() 方法如下:  public void run() {  System.out.print("go ");  }  及:   t.start();  t.start();  t.run();  哪一个是结果?()AgoBgo goCgo go goDgo 之后跟着一个异常

单选题
t 是一个合法的 Thread 对象的引用,并且 t 的合法 run() 方法如下:  public void run() {  System.out.print("go ");  }  及:   t.start();  t.start();  t.run();  哪一个是结果?()
A

go

B

go go

C

go go go

D

go 之后跟着一个异常


参考解析

解析: 暂无解析

相关考题:

My father didn't go to New York; the doctor suggested that he ()there. A、not to goB、won'tC、not goD、not to go to

The teacher warned the students ______ swimming in the lake. A.not to goB.don’t goC.not goD.to not go

If it ( ) tomorrow, we ( ) to the Summer Palace. A、rains, will goB、won't rain, goC、doesn't rain, will go

I want to go to the cinema, but you _____ with me.A. need not to goB. do not need goC. need not goD. need go not

If it rains tomorrow, we()out for a picnic.A. wouldn't goB. can't goC. won't go

classThread2implementsRunnable{voidrun(){System.out.print(go);}publicstaticvoidmain(String[]args){Thread2t2=newThread2();Threadt=newThread(t2);t.start();}}结果为:() A.goB.编译失败C.代码运行,无输出结果D.运行时异常被抛出

I want to go to the dentist, but you ______ with me.A、need not to goB、do not need goC、need not goD、need go not

t是一个合法的Thread对象的引用,并且t的合法run()方法如下:publicvoidrun(){System.out.print(go);}及:t.start();t.start();t.run();哪一个是结果?() A.goB.gogoC.gogogoD.go之后跟着一个异常

现有:t是一个合法的Thread对象的引用,并且t的合法run()方法如下:publicvoidrun(){System.out.print(go);}及:t.start();t.start();t.run();哪一个是结果?() A.gogoB.gogogoC.go之后跟着一个异常D.gogo之后跟着一个异常

Whose idea was it to go to the opera? I suggested________A.goB.to goC.that goD.going

He didn‘t go to France,the doctor suggested that he_______there.( )A.won‘t goB.not goC.not to goD.didn’t go

public class Threads3 implements Runnable {  public void run() {  System.out.print(”running”);  }  public static void main(String[] args) {  Thread t = new Thread(new Threads3());  t.run();  t.run();  t.start();  }  }  What is the result?() A、 Compilation fails.B、 An exception is thrown at runtime.C、 The code executes and prints “running”.D、 The code executes and prints “runningrunning”.E、 The code executes and prints “runningrunningrunning”.

现有:   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、 goB、 编译失败C、 代码运行,无输出结果D、 运行时异常被抛出

t 是一个合法的 Thread 对象的引用,并且 t 的合法 run() 方法如下:  public void run() {  System.out.print("go ");  }  及:   t.start();  t.start();  t.run();  哪一个是结果?() A、goB、go goC、go go goD、go 之后跟着一个异常

1. class MyThread implements Runnable {  2. public void run() {  3. System.out.print("go ");  4. }  5.  6. public static void main(String [] args) {  7. // insert code here  8. t.start(); 9. }  10. }  和如下四句:  Thread t = new MyThread(); MyThread t = new MyThread();  Thread t = new Thread(new Thread());  Thread t = new Thread(new MyThread());  分别插入到第5行,有几个可以通过编译?() A、0B、1C、2D、3

Which three will compile and run without exception?()A、private synchronized Object o;B、void go(){   synchronized(){/* code here */}C、public synchronized void go(){/* code here */}D、private synchronized(this) void go(){/* code here */}E、void go(){   synchronized(Object.class){/* code here */}F、void go(){   Object o = new Object();   synchronized(o){/* code here */}

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.

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.

现有:t是一个合法的Thread对象的引用,并且t的合法run()方法如下:  public void run()  {  System.out.print ("go");      }      及:  t.start();      t.start();      t.run();      哪一个是结果?()    A、go goB、go go goC、go之后跟着一个异常D、go go之后跟着一个异常

单选题public class Threads3 implements Runnable {  public void run() {  System.out.print(”running”);  }  public static void main(String[] args) {  Thread t = new Thread(new Threads3());  t.run();  t.run();  t.start();  }  }  What is the result?()A Compilation fails.B An exception is thrown at runtime.C The code executes and prints “running”.D The code executes and prints “runningrunning”.E The code executes and prints “runningrunningrunning”.

单选题现有:   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 goB 编译失败C 代码运行,无输出结果D 运行时异常被抛出

单选题现有:t是一个合法的Thread对象的引用,并且t的合法run()方法如下:  public void run()  {  System.out.print ("go");      }      及:  t.start();      t.start();      t.run();      哪一个是结果?()Ago goBgo go goCgo之后跟着一个异常Dgo go之后跟着一个异常

单选题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.

单选题1. class MyThread implements Runnable {  2. public void run() {  3. System.out.print("go ");  4. }  5.  6. public static void main(String [] args) {  7. // insert code here  8. t.start(); 9. }  10. }  和如下四句:  Thread t = new MyThread(); MyThread t = new MyThread();  Thread t = new Thread(new Thread());  Thread t = new Thread(new MyThread());  分别插入到第5行,有几个可以通过编译?()A0B1C2D3

单选题现有:  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();      }      }      结果为:()AgoB运行时异常被抛出C代码运行,无输出结果D编译失败

多选题class Order implements Runnable {  public void run() {  try { Thread.sleep(2000); } catch (Exception e) { }  System.out.print("in ");  }  public static void main(String [] args) {  Thread t = new Thread(new Order());  t.start();  System.out.print("pre ");  try { t.join(); } catch (Exception e) { }  System.out.print("post ");  } }  可产生哪两项结果?()Ain preBpre inCin pre postDpre in post

单选题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.