欢迎来到求知题库网 求知题库官网
logo
全部科目 > Java认证考试 > SCJP程序员认证考试

单项选择题

1. class A implements Runnable ( 
2. int i; 
3. public void run () ( 
4. try ( 
5. thread.sleep(5000); 
6. i= 10; 
7. ) catch(InterruptedException e) {} 
8. ) 
9. ) 
10.   
11. public class Test { 
12. public static void  main (string args[]) (
13. try ( 
14. A a = new A (); 
15. Thread t = new Thread (a); 
16. t.start(); 
17.   
18. int j= a.i; 
19.   
20. ) catch (Exception e) {} 
21. ) 
22. }  
Which statement al line 17 will ensure that j=10 at line 19?()  

    A. a.wait();
    B. t.wait();
    C. t.join();
    D. t.yield();
    E. t.notify();
    F. a.notify();
    G. t.interrupt();

点击查看答案&解析
微信小程序免费搜题
微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题

微信扫一扫,加关注免费搜题