What is the difference between HashMap and ConcurrentHashMap?

Solution:

ConcurrentHashMap is thread-safe; that is the code can be accessed by single thread at a time while HashMap is not thread-safe.ConcurrentHashMap does not allow NULL keys whileHashMap allows it.

0 answers