Iterate through HashMap?
I have a HashMap with some elements. Now I would like to generate a String that contains each key and its correpsponding value for all the tuples in the HashMap.
I have tried:
HashMap hm =new HashMap();
hm.put("5","read");
hm.put("6","crap");
hm.put("7","bob");
Set s = hm.entrySet();
Iterator ni = s.iterator();
String ss ="";
while (ni.hasNext())
{
ss =ss + ni.next();
}
System.out.println(ss);
but that gives me:
5=read7=bob6=****
why do I get the equal signs?

