sweety sinha wrote:
when this code runs print
ram2=5 ram=4
and size 2 but here no hashCode is used so it should print size 5
please help
thanks in advance
Hi.
Hashmap doesnt accept duplicate keys. So your hashmap s would only have 2 because you only have two keys "ram" and "ram2".
The other put operation wasn't successful because it has duplicate keys. By the way I think if it is not successful in putting it to the hashmap it will return false.