Map is object which maps keys to its values. Map can’t contain duplicate keys. Each key will map to one value. Map interface includes methods which can be used for general operations i.e.get, put, containsKey, containsValue, remove, size, and empty for bulk operations i.e. putAll and clear.
It provides three collection views methods which allow Map to be viewed as Collection in below ways:
Keyset: This method provides Set of the keys contained in Map.
entrySet: This method provides Collection of values contained in Map. Please note basically this Collection is not Set because we can have multiple keys that is map to same value.
Values: This method provides Set of key value pairs contained in Map. Map interface provides small nested interface that is called Map.Entry and type of the elements in this Set.