代码之家  ›  专栏  ›  技术社区  ›  Mohseen Mulla

只想将hashmap中的第一个键和第二个键赋给长变量xyzId1和xyzId2

  •  0
  • Mohseen Mulla  · 技术社区  · 7 年前
    public static Map<Long, Map<String, String>> xyz1 = new HashMap<Long, 
                                                         Map<String, String>>();
    Map<Integer, Integer> map = new HashMap<Integer, Integer>();
       for (Map.Entry<Long, Map<String, String>> entry : xyz1.entrySet()) {
            System.out.println("Key = " + entry.getKey() + ", Value = " + 
            entry.getValue());
            Long xyzId1 = entry.getKey();
            Long xyzId2 = entry.getKey();
    }
    

    0 回复  |  直到 7 年前