When we put a key instance say \"key\" and a Value instance say \"value\" in a HashMap
class using put()
method , what does the HashMap
If you talk about higher picture it is just like below.Here i refer item as a key
of Map
While Putting items.
hashcode
of key basket
with that hashcode
is present then use the equals
method on the key search the keys i that basket to determine if the element is to be added or replace.Get:
hashcode
of keyequals
on the key will return you that element from that basket.