if two keys has same hashCode? If multiple keys has same hashCode, than during put() operation collision had occurred, which means multiple Entry object stored in a bucket location. Each Entry keep track of another Entry, forming a linked list data structure there. Now, if we need to retrieve value object in this situation, following steps will be followed :
1) Call hashCode() method of key to find bucket location.
2) Traverse thought linked list, comparing keys in each entries using keys.equals() until it return true.
So, we use equals() method of key object to find correct entry and than return value from that.
For Coding Example ..follow this link - https://myshadesofgray.wordpress.com/2013/06/20/java-hash-collision-in-hashmap/