Different objects have the same hashCode #1136
Unanswered
StefanZlobin
asked this question in
Q&A
Replies: 1 comment
-
What are you trying to achieve here? Hashcodes aren't guaranteed to be unique for different objects. All objects could return the same |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone. Faced with the problem that two different objects have the same hashCode. Provided an example below. How to make sure that the hashCode is also different for different objects? (The override of equals and hashCode is in the generated files). The objects differ in the Map value in MenuDishModifiers.
Example:
Output result to the console:
My classes are provided below.
Beta Was this translation helpful? Give feedback.
All reactions