Multi-valued hashtable in Java

前端 未结 13 2037
余生分开走
余生分开走 2020-12-06 09:41

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?

13条回答
  •  旧巷少年郎
    2020-12-06 10:06

    You need to use something called a MultiMap. This is not strictly a Map however, it's a different API. It's roughly the same as a Map>, but you wont have methods like entrySet() or values().

提交回复
热议问题