Synchronization | Not synchronized (not thread safe) | Internally synchronized (thread safe) |
Null Elements | Allows one null key and any number of null values | Doesn’t allow null keys and null values |
Iterators | Returns fail-fast iterators | Returns fail-safe Enumerations |
Class Extension | Extends AbstractMap class | Extends Dictionary class |
Traversal | Returns only iterators | Returns both Iterator and Enumeration |
Speed | Fast | Slow |
Legacy Class | Not a legacy class | Is a legacy class |
Preferred Use | Preferred in single-threaded applications; for multi-threaded, wrap using Collections.synchronizedMap() | Not preferred nowadays for multi-threaded applications; ConcurrentHashMap is a better option |