
556 • Java Programming
18.7.2 Map.Entry Interface
The entrySet() method of Map returns a collection of objects that implements the Map.Entry interface.
Each object in the collection is a specifi c key-value pair or Map.entry object in the underlying Map . The
methods of this interface are given in the Table 18.9.
Method Signature Description
Boolean equals(Object obj)
Returns “true” if obj is a Map-Entry whose key and value are equal
to that of the invoking object.
Object getKey()
Returns the key for this map entry.
Object getValue()
Returns the value for this map entry.
int hasCode()
Returns the hash code for this map entry.
Object setValue(Object ...