Oracle
1Z0-851 · Question #222
1Z0-851 Question #222: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-851 to reveal the answer and full explanation for question #222. The question stem and answer options stay visible for context.
Question
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?
Options
- A1 2 3
- BCompilation fails because of an error in line 12.
- CCompilation fails because of an error in line 13.
- DCompilation fails because of an error in line 14.
- EA ClassCastException is thrown at runtime.
Unlock 1Z0-851 to see the answer
You've previewed enough free 1Z0-851 questions. Unlock 1Z0-851 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.