JAVA EXAMPLE PROGRAMS
Publish Your Article Here
Java2Novice - YouTube Channel
Difference between Enumeration and Iterator
The functionality of Enumeration and the Iterator are same. You can get remove() from Iterator to remove an element, while while Enumeration does not have remove() method. Using Enumeration you can only traverse and fetch the objects, where as using Iterator we can also add and remove the objects. So Iterator can be useful if you want to manipulate the list and Enumeration is for read-only access.
Millions long for immortality who do not know what to do with themselves on a rainy Sunday afternoon.
-- Susan Erz
|Reference: Java™ Platform Standard Ed. 7 - API Specification | Java™ Platform Standard Ed. 8 - API Specification | Java is registered trademark of Oracle.