Collections

Iterator

English

Overview

A mechanism for retrieving elements from a collection one at a time, in order.

Details

A common interface for traversing a collection's elements in order without needing to know its internal structure. Many implementations throw an exception such as ConcurrentModificationException if the underlying collection is modified during traversal, so safe removal requires using the iterator's own remove method.

More Programming terms