当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
计算机二级辅导:JAVA遍历Map所有元素
发布时间:2010/4/5 17:42:42 来源:城市学习网 编辑:admin
  //JDK1.5
  Map m = new HashMap();
  for (Object o : map.keySet()){
  map.get(o);
  }
  JDK1.4
  Map map = new HashMap() ;
  Iterator it = map.entrySet().iterator() ;
  while (it.hasNext())
  {
  Map.Entry entry = (Map.Entry) it.next() ;
  Object key = entry.getKey() ;
  Object value = entry.getValue() ;
  }
  :
广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved