0 votes
in DBMS by

What is the requirement for an object to be used as key or value in HashMap?

1 Answer

0 votes
by
  • The key or value object that gets used in the hashmap must implement equals() and hashcode() method.
  • The hash code is used when inserting the key object into the map and the equals method is used when trying to retrieve a value from the map.
...