nerdexam
Oracle

1Z0-819 · Question #133

1Z0-819 Question #133: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-819 to reveal the answer and full explanation for question #133. The question stem and answer options stay visible for context.

Question

Given: 1. Iterator iter = List.of(1,2,3).iterator(); 2. while (iter.hasNext()) { 3. foo(iter.next()); 4. } 5. Iterator iter2 = List.of(1,2,3).iterator(); 6. while (iter.hasNext()) { 7. bar(iter2.next()); 8. } 9. } 10. for (Iterator iter = List.of(1,2,3).iterator(); iter.hasNext(); ) { 11. foo(iter.next()); 12. } 13. for (Iterator iter2 = List.of(1,2,3).iterator(); iter.hasNext(); ) { 14. bar(iter2.next()); 15. } 16. Which loop incurs a compile time error?

Options

  • AThe loop starting line 11
  • BThe loop starting line 7
  • CThe loop starting line 14
  • DThe loop starting line 3

Unlock 1Z0-819 to see the answer

You've previewed enough free 1Z0-819 questions. Unlock 1Z0-819 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.

Full 1Z0-819 Practice