here containsKey() easily finds out that if there is any key in the map even if i don't write equals method but containsKey value gives proper output only if equals is there ...can anyone please explain why it happens in such way ???
after posting previos post i thought exactly that you said...
i thought keys are seached using their hashCode values
but when i run this code there is no call made to hashCode.;..
please clarify my doubt
This is not explicitly written in the API, but containsKey uses the Comparable interface of your objects to search for a key. containsValue uses the equal method only.