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
精彩评论