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.
正确答案:B
答案解析:有

微信扫一扫手机做题