Enumeration is older than Iterator, it was introduce since JDK1.0 . Iterator is used with Java arraylist, hashmap keyset and with other collection classes.
Functionality of Enumeration interface is inherited in Iterator Interface. Let´s see the major difference Enumeration and Iterator.
1. Iterator has remove() method while Enumeration does not have.
2. Enumeration works like Read-only interface, because it has the methods to traverse and fetch the objects, while Iterator can manipulate the objects like adding and removing the objects from collection.
3. Iterator is more secure and safe as compared to Enumeration because it does not allow other thread to modify the collection object while some thread is iterating over it and throws ConcurrentModificationException.
4. Iterator is newer and improved version where method names are shorter, and has new method called remove.
5