Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

Iterator
An iterator bassically 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. An Iterator provides the necessary behavior to get to each element in a collection without exposing the collection itself. In classes containing and manipulating collections, It is good practice to return an iterator instead of thecollection containing the elements we want to iterate over. This shields clients from internal changes to the data structures used in our classes.
Posted By: Name:Rajesh Kr URL: Iterator