This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Enumeration and Iterator gives you almost same facility.
What Ivor Horton author of Beginning Java 2 says in his book regarding that:
An enumerator provides essentially the same capability as an iterator, but it is recommended in the Java documentation that you use an iterator in preference to an enumerator for collections. There is nothing particularly wrong with enumerator- it's just that Iterator<> interface declares and optional remove() method that the Enumeration<> interface does not, and the methods in the Iterator<> interface have shorter names than those in the Enumeration<> interface, so code that uses them will be less cluttered.
Enumeration and Iterator are both interfaces. Enumeration is a legacy interface and is more generalized, you may find it anywhere in the entire api. Though it is commonly used with the legacy classes like the Vector and Hashtable it is also used independent of them also. eg. StringTokenizer. Iterator on the other hand is always used with a Collection, it always has an underlying Collection on which it operates. Also Iterator has an additional functionality which allows removal of element from the underlying Collection.