阿摩線上測驗 登入

試題詳解

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

試卷資訊

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

年份:104年

科目:OJCP(SCJP)

77. Given: 
11. public static void main(String[] args) { 
 12. Object obj = new int{1, 2, 3}; 
13. int[] someArray = (int[])obj; 
14. for (int i: someArray) System.out.print(i + " ");
 15. }
 What is the result?
(A) 1 2 3
(B) Compilation fails because of an error in line 12.
(C) Compilation fails because of an error in line 13.
(D) Compilation fails because of an error in line 14.
(E) A ClassCastException is thrown at runtime.
正確答案:登入後查看