What is an Iterator interface?- An iterator acts over a collection like an Enumeration. However, Iterators differ from enumerations in two ways:
1. The caller can remove elements from the collection during the iteration with well-defined semantics. 2. Method names have been improved.
- It is a member of the Java Collections Framework. - Iterator interface is a nice utility for collections. - It has a remove() method using which we can declare elements from the underlying object.
|