Concurrent Hashmap is a class that was introduced in jdk1.5. Concurrent hash map applies locks only at bucket level called fragment while adding or updating the map. So, a concurrent hash map allows concurrent read and write operations to the map.
HashTable is a thread-safe legacy class introduced in the Jdk1.1. It is a base implementation of Map interface. It doesn't allow null keys and values. It is synchronized in nature so two different threads can’t access simultaneously. Hashtable does not maintain any order.
Sr. No.
Key
HashTable
ConcurrentHashMap
1
Basic
HashTable is a thread-safe legacy class introduced in the Jdk1.1
ConcurrentHashmap is a class that was introduced in jdk1.5
2
Locking
It applies lock on the entire collection
ConcurrentHashMap apply locks only at bucket level called fragment while adding or updating the map
3
Performance
It is slower than ConcurrentHashMap
It is better than HashTable
4.
Null
It doesn't allow null key and value
It allows null key and value
https://www.tutorialspoint.com/difference-between-hashtable-and-concurrenthashmap-in-java