In Java, if I have HashMap<Integer, int[]> map
and want to lookup for a given int key
like map.get(key)
then the algorithm will compute key.hashCode()
, go to the corresponding bucket and search linearly for objects of type int[]
and compare them by using equals()
? So those int[]
objects in a bucket will have the same key (computed by hashCode
) and they will be compared by equals()
. Is that right?
I can not find on the web an example, where it is shown clearly. Only words.
What you are redirecting me at does not contain a normal understandable example, I do not need theory.