The SCJP 6 Study Guide from Bert Bates and Kathy Sierra states on page 554 (among other requirements) that x.hashCode() != y.hashCode() requires that x.equals(y) == false.
But the Javadoc for Object doesn’t mention such requirement explicitly. Quote:
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.
Should I take what Javadoc says as a material implication, such as eq -> hc? Then there would be no conflict between these two sources.
As z5h says, the statements are equivalent.
For logical conditions x and y, “x implies y” is the same as “!y implies !x”.
“If something is a bus, it’s red” is logically equivalent to “if something isn’t red, it’s not a bus.”
This is contraposition.
Yes, that’s exactly what it’s saying: two objects being equal under
equalsimplies their hashcodes must be equal.