阿摩線上測驗 登入

試題詳解

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

試卷資訊

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

年份:104年

科目:OJCP(SCJP)

227. Given: 
1. public class TestOne implements Runnable{ 
2. public static void main (String[] args)throws Exception{ 
3. Thread t = new Thread(new TestOne());
 4. t.start(); 
5. System.out.pririt("Started"); 
6. t.join(); 
7. System.out.print("Complete");
 8. } 
9. public void run(){ 
10. for(int i=0; i<4; i++){ 
11. System.out.print(i);
 12. } 
13. } 
14. }
 What can be a result?
(A) Compilation fails.
(B) An exception is thrown at runtime.
(C) The code executes and prints "StartedComplete".
(D) The code executes and prints "StartedComplete0123".
(E) The code executes and prints "Started0123Complete".
正確答案:登入後查看