ConcurrentHashmap vs HashTable, difference between ConcurrentHashmap and HashTable

Difference between ConcurrentHashmap and HashTable

ConcurrenthashMap is also threadsafe like Hashtable but it not fully locked like HashTable.
ConcurrentHashMap locked the only particular object that thread is working reamaning objects in the map is availble for all the threads.

and interoperable with Hashtable is possible.This class does not allow the null value as key or value.
Unlike Hastable it will not throw ConcurrentModificationException.  However, iterators are designed to be used by only one thread at a time. All the methods of map and Iterator interface are implemeted in this class. 

Share This

0 comments: