Java Map Interface
A map contains values on the basis of key i.e. key and value pair. Each key and value pair is known as an entry. Map contains only unique keys.
Map is useful if you have to search, update or delete elements on the basis of key.
Useful methods of Map interface
Entry is the sub interface of Map. So we will be accessed it by Map.Entry name. It provides methods to get key and value.
Methods of Map.Entry interface
Java Map Example: Generic (New Style)
102 Rahul 100 Amit 101 Vijay
Java Map Example: Non-Generic (Old Style)
1 Amit 2 Jai 5 Rahul 6 Amit