映射重复键但具有不同的值?

Pan*_*ari 0 java collections

有没有办法使用map或任何其他集合,允许我们存储
具有不同值的重复键...
而不是使用List来存储相同键的多个值?

Abh*_*jan 8

使用Google Guava的MultiMap.这允许使用单个键的多个值

http://guava-libraries.googlecode.com/svn/tags/release03/javadoc/com/google/common/collect/Multimap.html

  • +1,但OP应该意识到这实际上是"而不是使用List来存储同一个键的多个值?" (2认同)