public class Test {
public static void main(String[]args){
Map<String,String> map=new HashMap<String,String>();
map.put("zhangsan ","1234");
map.put("lisi","2345");
map.put("wangwu","5647");
map.put("zhaoliu","7894");
map.put("sunwu","9658");
Set<Map.Entry<String,String>> haha=map.entrySet();
Iterator<Map.Entry<String,String>> it=haha.iterator();
while(it.hasNext()){
Map.Entry<String,String> me=it.next();
String a=me.getKey();
String z=me.getValue();
System.out.println("ok--------------");
}
}
} |