posted 14 years ago
Hello everyone.
Trying a mock exam from coderanch, I fall into the question below:
"Given the following class House, which code fragments can be added to complete the equals() method without breaking the contract for hashCode()?"
I've selected two correct answers, but there is an answer provided by the mock that I think it is wrong. That is:
I don't think the statement above are true, because running the code below, I get the output
hashCode: true
equals: false
tks
Adolfo Eloy
Software Developer
OCPJP 6