• Post Reply Bookmark Topic Watch Topic
  • New Topic

Simple q on collection  RSS feed

 
Dinesh Tahiliani
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can any tell me the difference between Iterator ane Enumeration?
Pls explain with eg..

 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!