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

Enumerator Vs Iterator

 
velmurugan
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

What is the difference between Enumerator and Iterator?
Where we use Enumarator and where we use Iterator?

Any one Please help me...
 
naidu gulla
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The main difference is Enumerator does not provide a standard method for
for removing tehe objects.
Iterator has provided method for removing the objects.
 
Arafat Nalkhande
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well to start off with there is no class/interface in java called as Enumerator. Though there is Interface called Enumeration.

Iterator takes the place of Enumeration in the Java collections framework. Iterators differ from enumerations in two ways:

1) Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics.
2) Method names have been improved.
 
wise owen
Ranch Hand
Posts: 2023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This thread
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic