I am revising concepts of HashMap and just wanted to check how linked list implementation of each bucket of Entry class works.
public static void main(String[] args) {
HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
map.put(1, 1);
map.put(1, 2);
map.put(1, 3);
map.put(2, 1);
map.put(2, 2);
System.out.println(map.values());
}
}
Above code prints 3,2. Shouldn't it print 1, 2, 3, 1, 2.