Oracle
1Z0-803 · Question #98
1Z0-803 Question #98: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-803 to reveal the answer and full explanation for question #98. 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-803 to see the answer
You've previewed enough free 1Z0-803 questions. Unlock 1Z0-803 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.