Oracle
1Z0-815 · Question #112
1Z0-815 Question #112: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-815 to reveal the answer and full explanation for question #112. The question stem and answer options stay visible for context.
Question
Given the code fragment: 1. ArrayList<Integer> list = new ArrayList<>(1); 2. list.add(1001); 3. list.add(1002); 4. System.out.println(list.get(list.size())); What is the result?
Options
- ACompilation fails due to an error on line 1.
- BAn exception is thrown at run time due to error on line 3
- CAn exception is thrown at run time due to error on line 4
- D1002
Unlock 1Z0-815 to see the answer
You've previewed enough free 1Z0-815 questions. Unlock 1Z0-815 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.