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.

This thread has been viewed 511 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 10, 2018 10:52:24.