HashMap / HashTable / HashSet

  • Hashtable (Java Platform SE 9)

    • It does not allow null for both key and value. It will throw NullPointerException.
    • Hashtable does not maintain insertion order. The order is defined by the Hash function. So only use this if you do not need data in order.
    • It is synchronized. It is slow. Only one thread can access at one time.
    • HashTable read thread safe.
    • HashTable uses Enumerator to iterate through elements.

Continue reading