Could anyone be kind enough to elaborate on the concept of Enumeration? Your help will be greatly appreciated.
Joined: Nov 22, 2008
When I think of enumeration, I think of traversing the contents of a collection. Enumeration and Iteratation are an abstraction such that you don't have to worry about the collection's underlying structure. For instance, traversing a Vector is easy to manage because it's implemented as a dynamic array and, as such, you can use an index. But, to walk a linked list or a set, things are a bit different... Using Java's enumeration/iteration abstraction, you can use a common interface to traverse various types of collections.