Iterator
Visits elements of an Iterable one at a time.
Exhaustion and modification checks are defined by the implementation. ArrayList iterators use IllegalArgumentException for an invalid next call; hash iterators use NoSuchElementException for exhaustion and IllegalStateException for invalidation.
Type Parameters
T
element type.