An iterator over a collection. Iterator takes the place of Enumeration in the Java Collections Framework. Iterators differ from enumerations in two ways:
Iterator
Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics. Method names have been improved. Copy
Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics. Method names have been improved.
This interface is a member of the
Java Collections Framework.
An Enumeration can be converted into an Iterator by using the Enumeration#asIterator method.
type of elements returned by this iterator
Josh Bloch
1.2
Returns true if the iteration has more elements. (In other words, returns true if #next would return an element rather than throwing an exception.)
true
true if the iteration has more elements
Returns the next element in the iteration.
the next element in the iteration
NoSuchElementException if the iteration has no more elements
An iterator over a collection.
Iterator
takes the place of Enumeration in the Java Collections Framework. Iterators differ from enumerations in two ways:This interface is a member of the
Java Collections Framework.
Api Note
An Enumeration can be converted into an
Iterator
by using the Enumeration#asIterator method.Param: the
type of elements returned by this iterator
Author
Josh Bloch
See
Since
1.2