Home > DeveloperSection > Interviews > What is the difference between Iterator and Enumeration?

Posted on    May-12-2015 1:35 AM

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

Mayank Tripathi
Mayank Tripathi

Total Post:807

Points:4035
Posted on    May-12-2015 1:35 AM

Iterator
1)Iterator can traverse legacy and non-legacy elements.
2)Iterator is fail-fast.
3)Iterator is slower than Enumeration.


Enumeration
1)Enumeration can traverse only legacy elements.
2)Enumeration is not fail-fast.
3)Enumeration is faster than Iterator.

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

Follow MindStick