I read that HashTable can map same key to multiple values. That's what collision is.
Now I run the program like this:
Dictionary<String,String> hTable = new Hashtable<String,String>();
hTable.put("a", "aa");
hTable.put("a", "ab");
System.out.println(""+hTable.get("a"));
My thinking says I should get aa
and ab
.
But actual output is ab
Why is it so? Where is the collision then?