black

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();

相关考题

单项选择题 Whichmethodisanappropriatewaytodeterminethecosineof42degrees?()

填空题 Public class test (  Public static void stringReplace (String text)  (  Text = text.replace (‘j’ , ‘i’);  )  public static void bufferReplace (StringBuffer text)  (  text = text.append (“C”)  )   public static void main (String args[]}  (  String textString = new String (“java”); StringBuffer text BufferString = new StringBuffer (“java”);  stringReplace (textString);  bufferReplace (textBuffer);  System.out.printLn (textString + textBuffer);  ) )  What is the output?()

单项选择题 String a = “ABCD”;  String b = a.toLowerCase();  b.replace(‘a’, ‘d’);  b.replace(‘b’, ‘c’);  System.out.println(b);   What is the result? ()

All Rights Reserved 版权所有©建筑考试题库(jzkao.com)

备案号:湘ICP备2020024380号-3