HashMap and HashTable:
1) Hashtable and Hashmap implement the java.util.Map interface
2) Both Hashmap and Hashtable is the hash-based collection. and working on hashing. so these are similarity of HashMap and HashTable.
- What is the difference between HashMap and HashTable?
1) The first difference is HashMap is not thread safe While HashTable is ThreadSafe
2) HashMap is performance wise better because it is not thread safe. while Hashtable performance wise is not better because it is thread safe. so multiple thread cannot access Hashtable at the same time.