When I tried to use the hashtable class, Netbeans gave me an error saying:
While still supported, these classes were made obsolete by the JDK1.2 colle
Summary
The closest replacement is HashMap (usually via the Map interface).
But note that Hashtable is thread-safe while HashMap is not. This is not a problem in most cases and it was intentional to make most Java collections non-thread-safe to avoid performance penalty for most common scenarios. But if you relied on Hashtable thread-safety and now need a replacement that would also be thread-safe then you have two options: