Wiki Markup |
---|
According to the \[[API 06|AA. Java References#API 06]\] class {{java.lang.Object |
}} documentation: |
If two objects are equal according to the
equals(Object)
method, then calling the hashCode method on each of the two objects must produce the same integer result.
...
Failure to follow this contract is a source of common bugs. Notably, immutable objects need not override the hashcode()
method.
Noncompliant Code Example
...