Saturday, March 31, 2001 04:27 PM
There are some timing numbers in Practical Java. According to it....
An Enumeration is 12% faster than an Iterator/ListIterator, but a for-loop with get() is about 30% faster than that.
Also, don't get the size() each time. You only need to get it once.
What's the fastest way to traverse all the elements of a Vector? covers this in further details.