Join Examsbook
1103 0

Q: When do you override hashcode and equals() ?

  • Show AnswerHide Answer
  • Workspace

Answer :
Explanation :

HashCode method return int value. So the Hash value is the int value returned by the hash function . If you want to do equality check or want to use your object as key in HashMap, we must override hashcode and equals() method.

Are you sure

  Report Error

Please Enter Message
Error Reported Successfully