阿摩線上測驗 登入

試題詳解

試卷:104年 - SCJP 201-244#99410 | 科目:OJCP(SCJP)

試卷資訊

試卷名稱:104年 - SCJP 201-244#99410

年份:104年

科目:OJCP(SCJP)

231. Given: 
11. Runnable r = new Runnable(){ 
12. public void run(){ 
13. System.out.print("Cat"); 
14. } 
15. }; 
16. Thread t = new Thread(r){
 17. public void run(){ 
18. System.outprint("Dog"); 
19. }
 20. }; 
21. t.start();
 What is the result?
(A) Cat
(B) Dog
(C) Compilation fails.
(D) The code runs with no output.
(E) An exception is thrown at runtime.
正確答案:登入後查看