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

public class A extends


public class A extends Thread {  A() {  setDaemon(true);  }  public void run() {  (new B()).start();  try {  Thread.sleep(60000);  } catch (InterruptedException x) {}  System.out.println(“A done”);  }  class B extends Thread {  public void run() {  try {  Thread.sleep(60000);  } catch (InterruptedException x) {}  System.out.println(“B done”);  }  }  public static void main(String[] args) {  (new A()).start();  }  }   What is the result?()  

  • A A done
  • B B done
  • C A done B done
  • D B done A done
  • E There is no exception that the application will print anything.
  • F The application outputs “A done” and “B done”, in no guaranteed order.
参考答案
参考解析:
分类:SCJP程序员认证考试题库
相关推荐

1、10. public class Class

10. public class ClassA { 11. public void methodA() { 12. ClassB classB = new ClassB()...

2、class ThreadBoth extends&en

class ThreadBoth extends Thread implements Runnable { public void run(){ System.out.print("hi "); ...

3、1. public class A&ensp

1. public class A { 2. void A() { 3. System.out.println(Class A); 4. } 5. public&ensp...

4、1. class Exc0 extends&

1. class Exc0 extends Exception { } 2. class Exc1 extends Exc0 { } 3. public class&en...

5、class Parser extends U

class Parser extends Utils { public static void main(String [] args) { try { System.out.print...

6、class A {  public&ensp

class A { public A() { System.out.println(hello from a); } } class B extends A {&ensp...