ConcurrentHashMap
allow conurrent modification of the Map
elements from several threads without the need to block them but HashMap
block the whole HashMap
object and not elements of it as in ConcurrentHashMap
right?
But what if one thread get the count of the ConcurrentHashMap
as 10 and meanwhile another thread removes an item from that thread. Then that first thread count become false right?