Forums Register Login
Simple q on collection
Can any tell me the difference between Iterator ane Enumeration?
Pls explain with eg..

I don't think this is a question that should be asked in the advanced forum. Anyway, Iterator allows you remove the item, Enumeration doesn't. Basically, Iterator can do whatever the Enumeration can.
Enumeration is part of the old Java collections API (from Java 1.1 and older). In Java version 1.2, the new collections framework was added. Iterator is part of the new collections framework. The old classes like Enumeration, Vector and Hashtable were not removed to ensure backwards compatibility.

See The Collections Framework.
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:

This thread has been viewed 468 times.

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2018 21:44:47.