刚刚代码改成这样就Ok了 ,真古怪和我比较不一样
public static void main(String[] args) {
// TODO Auto-generated method stub
Map<Integer,String> a=new HashMap<Integer,String>();
a.put(3, "ee");
a.put(55, "ee");
a.put(44, "dd");
a.put(33, "cc");
a.put(22, "vbm");
a.put(11, "mm");
a.put(6, "cxvx");
Set<Integer> set=a.keySet();
// Iterator<Integer> i=set.iterator();
// while(i.hasNext()){
// System.out.println(a.get(i.next()));
// }
for( Iterator<Integer> i=set.iterator();i.hasNext();){
System.out.println(a.get(i.next()));
}
}
}
|