posted 12 years ago
First of all, forget about class Hashtable. Use class HashMap instead. Hashtable is an old, legacy collection class that has been replaced by HashMap.
You can choose any type you like for the keys and values of a HashMap. The type that you use for the keys has to have an appropriate implementation of the equals and hashCode methods. Here is an example where the keys are strings and the values are Person objects.