Re: Difference between Hashtable and Enumeration
Wednesday, December 1, 2004 09:12 PM
Hashtable: is used for Key-Value pair data structures. Use of Hashtable is Threadsafe and hence is little slower. The same work which a Hashtable does, can also be achived by Using Hashmap, but Hashmaps are not threadsafe but fast.
Enumeration: It is interface that is used to iterate over element by elemnt over the collection of the elements. You cannot remove the elements of a collection if u r using the Enumeration interface. The same work which a Enumeration does, can also be achieved by Using Iterator interface. Using Iterator interface, you can remove the elements of the collection.
I hope this satisfies you.