Monday 6 May 2013

How will you retrieve Value object if two Keys will have same hashcode?


  • We will call get() method and then HashMap uses Key Object's hashcode to find out bucket location. 
  • After finding bucket location , we will call keys.equals() method to identify correct node in LinkedList and return associated value object for that key in Java HashMap.

No comments:

Post a Comment