I have a little wondering about Iterator and Enumeration.
What is the benefit using one of these interface ? from all my
understanding, it just used for looping. But there's Vector or Hashcode or
any class that support looping elements.
I saw lots code that using those interface only for looping. I saw a
Collection object changed into Iterator and in the next line i found that it
just for looping and get the Collection value, or in the sun example about
Enumaration, it changed Vector into Enumeration and do Enumeration.next() to
looping and get the value.
I can do that with For () Statement, without using Iterator or Enumeration.
Anyone can gimme good explanation about the reason ?