Multi-valued hashtable in Java
问题 Is it possible to have multiple values for the same key in a hash table? If not, can you suggest any such class or interface which could be used? 回答1: No. That's kind of the idea of hash tables. However, you could either roll your own with a Map<YourKeyObject, List<YourValueObject>> and some utility methods for creating the list if it's not present, or use something like the Multimap from Google Collections. Example: String key = "hello"; Multimap<String, Integer> myMap = HashMultimap.create(