If x.equals(y) is false, then x==y may be true [FALSE]
cmbhatt
cmbhatt
Thanks Anil and Sharan to stick to the true facts. I think we should generally adhere to the facts pointed by Anil and Sharan.
cmbhatt
If class Dog follows the equals the equals and hashCode contracts, and
if x and y are reference variables for two Dog objects, which statements are true? (Choose all that apply)
A. If x.equals(y) is true, then x==y must be true
B. If x.equals(y) is false, then x==y may be true
C. If x.equals(y) is true, then x==y may be false
D. If x.equals(y) is true, then (x.hashCode() == y.hashCode()) may be
false.
E. If x.equals(y) is false, then (x.hashCode()==y.hashCode()) may be true
F. If x==y is false, then x.equals(y) must be false.
cmbhatt
Originally posted by madhu v pe:
Hi All,
Please any one can clarify the foll statement from K&BOverrding equals() topic.
Thanks
cmbhatt
When all four tires fall off your canoe, how many tiny ads does it take to build a doghouse?
Garden Master Course kickstarter
https://coderanch.com/t/754577/GardenMasterkickstarter
