File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

iterator vs Enumeration

 
vara prasad
Ranch Hand
Posts: 47
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the difference between iterator and Enumeration
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iterator is newer than Enumeration, and its method names are shorter because it was felt that the old ones were too long and awkward. Also, Iterator has an optional method that lets you remove the current element from a collection -- Enumeration doesn't have that.

In any case, Iterator is meant as a replacement for Enumeration. You shouldn't use Enumeration unless you're forced to by a legacy API.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic