Hash Map with LinkedList in java
问题 Is there a built in implementation in java for hash map whose values are linked lists? like, if I put: map.put(1, "A"); map.put(1, "B"); then it automatically add A and B to the linked list. When I retrieve from the map, as: map.get(1) I get back a list containing both of them? 回答1: Java does not have it but you can use MultiMap from Google Guava. A collection similar to a Map, but which may associate multiple values with a single key. If you call put(K, V) twice, with the same key but