0

We know if two objects are equal, their hashCode must be matched. If two hashCode is matched, their objects could be equal, could not be equal. So please check the logic below to see if it is true.

equals() YES ---> hashCode() YES

hashCode() NO ---> equals() NO

equals() NO ---> hashCode() YES or NO

hashCode() YES ---> equals() YES or NO

Allen
  • 11
  • 4

0 Answers0