ConcurrentHashMap

A thread-safe Map whose updates such as merge and compute run atomically per key.

In more detail

Many threads can read and update it without external locking, and its iterators never throw ConcurrentModificationException. It rejects null keys and values. It implements the ConcurrentMap interface.

Example

map.merge(word, 1, Integer::sum);

Related terms

Taught in

References

Certification courses