Multiple choice technology programming languages

Iterator for a collection will update along with the collection, when it is modified and give the updated one while traversing.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Iterators in Java are 'fail-fast' - they throw ConcurrentModificationException if the collection is modified during iteration (except through the iterator's own remove method). The iterator does not automatically update to reflect changes made directly to the collection during traversal.