- Type Parameters:
E
- the type of object returned by the iterator.
- All Known Subinterfaces:
- ListIterator<E>
public interface Iterator<E>
An Iterator
is used to sequence over a collection of objects.
Conceptually, an iterator is always positioned between two elements of a
collection. A fresh iterator is always positioned in front of the first
element.
If a collection has been changed since its creation, methods next
and
hasNext()
may throw a ConcurrentModificationException
.
Iterators with this behavior are called fail-fast iterators.