Hashtable and Hashmap

Similarities between Hashtable and Hasbmap

  • Both extend Map Interface
  • Both work on hashing principle
  • Both are part of collection package
  • Both provide constant time performance for put and get methods, if objects are distributed in uniform buckets

Differences between Hashtable and Hasbmap

  • Hashtable - Threadsafe whereas Hashmap - Not Threadsafe
  • Hashtable - Synchronised and not better performance as Hashmap
  • Hashtable - Obselete(No Longer Available) class - Replace it by ConcurrentHashMap