This is the code which i ve been trying.
Map map=new HashMap();
map.put(new Integer(i),str[i] );
I tried your code changing the objects we put into the map.It gave a diiferent hashCode() then. I think you got the same hashCode() coz
here the objects we put are same.But How does it work?Coz the key cant be a duplicate one rite?