Skip to content

Difference between Map and Map.Entry interface

What is the difference(if any) between Map and Map.Entry<K,V> interface and what is the purpose of Map.Entry<K,V> interface?


The Map interface describes a data structure that stores key-value entries. The Map.Entry interface describes the structure of these entries, stores and provides a way of retrieving the associated key and value (dependent on implementation).

These interfaces are implemented by concrete classes that implement the functionality described by the interfaces.

Map docs:

Map.Entry docs: