Home » Interview » Technology

When do you override hashcode and equals() ?

Correct Answer: 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

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion