Chapter 7: Page number 553:
this one-hash-fits-all method would be considered appropiate and even correct because it does not violate the contract
Matloob
OCPJP 1.6
OCPWCD in progress.....
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
Matloob
OCPJP 1.6
OCPWCD in progress.....
Matloob Hussain wrote:
when we are checking the appropiate implementation of hashCode() method, do we need to follow its equals() method as well?
OCJP6, OCWCD5
Matloob
OCPJP 1.6
OCPWCD in progress.....
SCJP6.0,My blog Ranchers from Delhi
OCPJP 6.
In Your Pursuit Towards Certification, NEVER Give Up.
Shanky wrote:
we have to write first equals() methods and then check if the two objects are equals if they are equals then use hashcode method to put them in same bucket...
Matloob
OCPJP 1.6
OCPWCD in progress.....
Honk if you love justice! And honk twice for tiny ads!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|