现有: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之后跟着一个异常

题目

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

  • A、go go
  • B、go go go
  • C、go之后跟着一个异常
  • D、go go之后跟着一个异常

相似考题
更多“现有: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之后跟着一个异常”相关问题
  • 第1题:

    If it rains tomorrow, we _________ to picnic.

    A、wouldn't go to

    B、can't go

    C、won't go


    参考答案:C

  • 第2题:

    classThread2implementsRunnable{voidrun(){System.out.print("go");}publicstaticvoidmain(String[]args){Thread2t2=newThread2();Threadt=newThread(t2);t.start();}}结果为:()

    A.go

    B.编译失败

    C.代码运行,无输出结果

    D.运行时异常被抛出


    参考答案:B

  • 第3题:

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

    A.go

    B.gogo

    C.gogogo

    D.go之后跟着一个异常


    参考答案:D

  • 第4题:

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

    A.gogo

    B.gogogo

    C.go之后跟着一个异常

    D.gogo之后跟着一个异常


    参考答案:C

  • 第5题:

    1. public class GoTest {  2. public static void main(String[] args) {  3. Sente a = new Sente(); a.go();  4. Goban b = new Goban(); b.go();  5. Stone c = new Stone(); c.go();  6. }  7. } 8.  9. class Sente implements Go {  10. public void go() { System.out.println(”go in Sente.”); }  11. }  12.  13. class Goban extends Sente {  14. public void go() { System.out.println(”go in Goban”); }  15. }  16.  17. class Stone extends Goban implements Go { }  18.  19. interface Go { public void go(); }  What is the result?() 

    • A、 go in Goban     go in Sente go in Sente
    • B、 go in Sente      go in Sente go in Goban
    • C、 go in Sente     go in Goban go in Goban
    • D、 go in Goban    go in Goban go in Sente
    • E、 Compilation fails because of an error in line 17.

    正确答案:C

  • 第6题:

    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 之后跟着一个异常

    正确答案:D

  • 第7题:

    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 */}

    正确答案:C,E,F

  • 第8题:

    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、运行时异常被抛出

    正确答案:B

  • 第9题:

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

     运行时异常被抛出


    正确答案: C
    解析: 暂无解析

  • 第10题:

    多选题
    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 */ }


    正确答案: B,D
    解析: 暂无解析

  • 第11题:

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


    正确答案: D
    解析: 暂无解析

  • 第12题:

    单选题
    现有:  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

    编译失败


    正确答案: C
    解析: 暂无解析

  • 第13题:

    If it rains tomorrow, we()out for a picnic.

    A. wouldn't go

    B. can't go

    C. won't go


    参考答案:C

  • 第14题:

    I want to go to the dentist, but you ______ with me.

    A、need not to go

    B、do not need go

    C、need not go

    D、need go not


    参考答案:C

  • 第15题:

    现有:classThread2implementsRunnable{voidrun(){System.out.print("go");}publicstaticvoidmain(String[]args){Thread2t2=newThread2();Threadt=newThread(t2);t.start();}}结果为:()

    A.go

    B.编译失败

    C.代码运行,无输出结果

    D.运行时异常被抛出


    参考答案:B

  • 第16题:

    He didn‘t go to France,the doctor suggested that he_______there.( )

    A.won‘t go
    B.not go
    C.not to go
    D.didn’t go

    答案:B
    解析:

  • 第17题:

    现有:   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、 运行时异常被抛出

    正确答案:B

  • 第18题:

    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、0
    • B、1
    • C、2
    • D、3

    正确答案:C

  • 第19题:

    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.

    正确答案:B

  • 第20题:

    单选题
    现有:   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

     运行时异常被抛出


    正确答案: B
    解析: 暂无解析

  • 第21题:

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

    go go

    B

    go go go

    C

    go之后跟着一个异常

    D

    go go之后跟着一个异常


    正确答案: C
    解析: 暂无解析

  • 第22题:

    单选题
    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 之后跟着一个异常


    正确答案: A
    解析: 暂无解析

  • 第23题:

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

    运行时异常被抛出


    正确答案: C
    解析: 暂无解析