October 16, 2010 at 5:22 PM
An iterator over a collection. Iterator takes the place of Enumeration in the Java collections framework. Iterators differ from enumerations in two ways:
Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics.
Method names have been improved.
The iterator interface have these methods-
Iterator Interface is part of java.util package.
It is used to retrieve the elements in the collection object one by one.
the iterator interface is obtained by using iterator() on the collection object.