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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…