map.entrySet().iterator 素颜马尾好姑娘i 2022-06-02 07:07 183阅读 0赞 public static void main(String\[\] args) \{ Map map = new HashMap(); map.put("1", "value1"); map.put("2", "value2"); Iterator it = map.entrySet().iterator(); while(it.hasNext())\{ Map.Entry entry = (Map.Entry) it.next(); Object key = entry.getKey(); Object val = entry.getValue(); System.out.println(key); System.out.println(val); \} \}
还没有评论,来说两句吧...