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.
HashMap<Integer, int[]>thengetwill returnint[]. If you actually wanted some element in that array, you'll have to search yourself.HashMapthere can only be one value per key. For more values per key, you need aMultiMap.hashCodeandequalsare relevant to key only. It doesn't not do anything with the value, it just returns the reference to it.