The Map interface in the collections framework is a bit different than all others interfaces we have covered earlier; unlike others it works with key-value pairs. No, this is not similar to Pair; Pair is just a pair of two values combined together, while a map is a collection of key-value pairs.
In a map, keys are unique and cannot be duplicated. If you add two values with the same key, then the later one will replace the previous one. Values, on the other hand can be redundant/duplicate. The reason behind this behavior is that in a map, a value is stored and retrieved with respect to its key, so redundant keys will make it impossible to distinguish them from each-other and to fetch their values.
The declaration of Map ...