Corner of the web where i pen down my tech experience
map.put(null,null); map.put(null,"D"); map.put(null,"E");
it will return null in first case.'D' in second case.
Bang on the target, the older values get overridden if new values are put into hashtable/hashMap using the same key.I posted a workaround for this a couple of days back, using an arrayList as a value is a better option, check out this example for adding multiple values to a key in hashmap :)http://lifeofalazycoder.blogspot.com/2009/05/java-adding-multiple-values-to-key-in.html
Post a Comment