public static  void main(String[] args){
  Map map=new HashMap();
  map.put("1", 21);
  map.put("2", 123);
  map.put("3", 98);
  
//   方法1    此方法效率比较高 
  Iterator ite=map.entrySet().iterator();
  while(ite.hasNext()){
   Entry string=(Entry)ite.next();
        System.out.print(string.getKey()+"/"); 
        System.out.println(string.getValue()); 
  } 
//   方法2 此方法效率比较低  
     Iterator iteKey=map.keySet().iterator();
     while(iteKey.hasNext()){
      Object key=iteKey.next();
            Object value=map.get(key);
            System.out.print(key+"/");
            System.out.println(value);
      
     }
  
//  方法3 
    Set<Entry<String, Integer>> set = map.entrySet();
        for(Entry<String, Integer> entry: set)
        {
            System.out.println(entry.getKey() + "/" + entry.getValue());
        }
 }