0
What is the difference between Iterator and Enumeration in JAVA?

Open 1 Answers 4 Views Education
What is the difference between Iterator and Enumeration in JAVA?

1 Answer

0

Following are the differences:- 

No. Iterator Enumeration
1) The Iterator can traverse legacy and non-legacy elements. Enumeration can traverse only legacy elements.
2) The Iterator is fail-fast. Enumeration is not fail-fast.
3) The Iterator is slower than Enumeration. Enumeration is faster than Iterator.
4) The Iterator can perform remove operation while traversing the collection. The Enumeration can perform only traverse operation on the collection.
by (280k points)
...