Map

HashMap vs Hashtable

HashMapHashtable
Introduced in1.21.0
Thread SafetyNot thread safe (not synchronized) => works with single threadThread safe (synchronized) => works with multiple threads
SpeedFasterSlower
Null keyOne null key allowedNull key not allowed

Child classes/interfaces:


Children
  1. HashMap
  2. Hashtable
  3. IdentityHashMap
  4. SortedMap
  5. WeakHashMap

Backlinks