AnjanN wrote:By making sure that equal objects return true from the equals() method (and non-equal objects return false).
How can we use object as key in a collection by overriding the hashcode() and equals() method.
I cannot understand the real logical picture behind that.Well, perhaps you should Google around for an explanation.
AnjanN wrote:Easily. You can implement hashcode() as "return 1;", it will just perform poorly and completely bypass the idea of hashing in the first place, but it will work.
it can be the same for non-equal objects too
how can that be possible that two different objects having same hashcodes..