posted 20 years ago
Regarding Iterator vs Enumeration: Use Iterator, which is intended as a replacement for the older Enumeration interface. Only use Enumeration when you're forced to while working with legacy code.
Regarding Iterator vs looping with "get(i)" on a list: there are many considerations; it depends on the type of container, where you're using it, how you're using it, whether clarity or performance matters more, etc. My recommendation, in general, is to use Iterator, but if you find after profiling your code that a tiny little bit of increased performance would help, then you can try looping with "get()".
[ July 13, 2004: Message edited by: Ernest Friedman-Hill ]