阿摩線上測驗 登入

試題詳解

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

試卷資訊

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

年份:104年

科目:OJCP(SCJP)

241. Given: 
1. public class Threads3 implements Runnable{ 
2. public void run(){ 
3. System.out.print("running");
 4. }
 5. public static void main(String[] args){ 
6. Thread t = new Thread(new Threads3()); 
7. t.run(); 
8. t.run(); 
9. t.start(); 
10. } 
11. }
 What is the result?
(A) Compilation fails.
(B) An exception is thrown at runtime.
(C) The code executes and prints "running".
(D) The code executes and prints "runningrunning".
(E) The code executes and prints "runningrunningrunning".
正確答案:登入後查看