Home > DeveloperSection > Interviews > What is an Iterator?

Posted on    July-21-2015 10:25 PM

 Java Java  Collection 
Ratings:
 1 Answer(s)
  350  View(s)
Rate this:

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    July-21-2015 10:25 PM

Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally it is not advisable to modify the collection itself while traversing an Iterator.

Don't want to miss updates? Please click the below button!

Follow MindStick