Internals of how the HashMap put() and get() methods work (basic logic only )
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 class do internally . How does it retrieve the value back when we say hashMap.get(key) ? Edit : I do not want details here , basically trying to understand the bigger picture and the role of equals() and hashcode() method in put() and get() operations. amicngh If you talk about higher picture it is just like below.Here i refer item as a key of Map While Putting items. Calculate hashcode of key If basket with that hashcode is present then use the equals method on