0% found this document useful (0 votes)
34 views

Method Description: Classcastexception Is Thrown If V Is Not Illegalargumentexception Is Thrown If There Is

This document describes the methods defined by the Map.Entry interface in Java, including equals(), getKey(), getValue(), hashCode(), and setValue(). equals() returns true if the keys and values are equal between map entries. getKey() and getValue() return the key and value of the map entry. hashCode() returns the hash code and setValue() sets the value, potentially throwing exceptions if the value is invalid.

Uploaded by

Abdul Gafur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Method Description: Classcastexception Is Thrown If V Is Not Illegalargumentexception Is Thrown If There Is

This document describes the methods defined by the Map.Entry interface in Java, including equals(), getKey(), getValue(), hashCode(), and setValue(). equals() returns true if the keys and values are equal between map entries. getKey() and getValue() return the key and value of the map entry. hashCode() returns the hash code and setValue() sets the value, potentially throwing exceptions if the value is invalid.

Uploaded by

Abdul Gafur
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Method 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 hashCode( ) Returns the hash code for this map entry.
Object setValue(Object v) Sets the value for this map entry to v. A
ClassCastException is thrown if v is not
the correct type for the map. An
IllegalArgumentException is thrown if there is
a problem with v. A NullPointerException is
thrown if v is null and the map does not permit
null keys. An UnsupportedOperationException
is thrown if the map cannot be changed.
Table 15-8. The Methods Defined by Map.Entry




































\

You might also like