| Author |
Difference between enuernation and Iterator in Java Collection.
|
Prabhat Ranjan
Ranch Hand
Joined: Oct 04, 2006
Posts: 361
|
|
Hi,
As we know Enumeration is deprecated Interface in Java Collection..
So what is the exact difference between enuernation and Iterator .
Please share !
Regards,
Prabhat
|
 |
Ernest Friedman-Hill
author and iconoclast
Marshal
Joined: Jul 08, 2003
Posts: 24041
|
|
|
Well, they're interfaces, so the only differences are the names and signatures of the methods. Iterator has shorter method names, which don't clutter your code as much, and it has the "remove()" method, which Enumeration lacks. That's it.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Prabhat Ranjan
Ranch Hand
Joined: Oct 04, 2006
Posts: 361
|
|
yes correct !
thanks
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
Enumeration is not deprecated, it is merely discouraged. It's the same as Vector vs ArrayList.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Difference between enuernation and Iterator in Java Collection.
|
|
|