开发者

Hashtable same Key with different value....?

Is it possible with java that a hashtable can map the same keys to different values? .. How can I retrieve both value from h开发者_运维知识库ashtable...


you cannot, unless you store the key's value as a list of values.

take a look at google's Multimap: http://google-collections.googlecode.com/svn/trunk/javadoc/index.html?com/google/common/collect/Multimap.html


You cant do that, All the keys in the Hash map or Hash Table should be unique.

Else then you need to consider a different Collection

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜