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
I'm not sure if I approve of this interruption. But this tiny ad checks out:
a bit of art, as a gift, that will fit in a stocking
https://gardenergift.com
