Computer Science, asked by Swetav8761, 10 months ago

What happens if we don't override equals and hashcode

Answers

Answered by Anonymous
0

\huge\mathbb\green{BONJOUR,}

\huge\mathfrak{Answer:}

You must override hashCode in every class that overrides equals. Failure to do so will result in a violation of the general contract for Object.hashCode, which will prevent your class from functioning properly in conjunction with all hash-based collections, including HashMap, HashSet, and Hashtable.

<font color ="purple"><marquee behavior ="alternate"> ~♥~~♥~Hope It Helps~♥~~♥~</font color ="purple "></marquee behavior="alternate">

\huge\mathfrak{Regards}

\huge\mathbb\red{Aaravxxx}

Similar questions