Iterator<Entry<Integer, Integer>> it=map.entrySet().iterator();
while(it.hasNext()){
Entry<Integer, Integer> temp=it.next();
System.out.println(temp.getKey()+" "+temp.getValue());
}
Set<Integer> set=map.keySet();
Iterator<Integer> iter=set.iterator();
while(iter.hasNext()){
Integer temp=iter.next();
System.out.println(temp+" "+map.get(temp));
}