阿摩線上測驗 登入

試題詳解

試卷:104年 - SCJP 51-100#99391 | 科目:OJCP(SCJP)

試卷資訊

試卷名稱:104年 - SCJP 51-100#99391

年份:104年

科目:OJCP(SCJP)

76. Given:
 1. class TestA{ 
2. public void start(){System.out.println("TestA");} 
3. } 
4. public class TestB extends TestA{ 
5. public void start(){System.out.println("TestB");}
 6. public static void main(String[] args){ 
7. ((TestA)new TestB()).start(); 
8. } 
9. }
 What is the result?
(A) TestA
(B) TestB
(C) Compilation fails.
(D) An exception is thrown at runtime.
正確答案:登入後查看