Entry Interface: Map interface contains the Entry interface. So, Entry is the subinterface of Map. So, we can access it by Map.Entry name. The Map.Entry interface enables you to work with a map entry. The Entry interface returns a collection-view of the map. Entry has some methods to access the Map and manipulate it.
Methods:
1. getKey(): It returns the key from entry Map. It will throw IllegalStateException if the entry has been removed from the backing map.
2. getValue(): It returns the value from entry Map. It will throw IllegalStateException if the entry has been removed from the backing map.
3. setValue(V value): This method is used to set the value in Map. It will throw
ClassCastException, if the class of the value is not an acceptable by map.
NullPointerException, if Value ‘v’ is null and null is not supported by map.
UnsupportedOperationException, if manipulate of map is not supported by the map.
IllegalArgumetException, if there is some problem with the argument.
IllegalStateException, ifentry has been removed from the map.
4. equal(): It compares the specified object o with entry for equality.
5. hashCode(): It returns the hash code value for map entry.