key相同合并Map

public class Demo11 {

public static void main(String[] args) {
ConcurrentHashMap<Integer, Map<Integer,String>> map = new ConcurrentHashMap<Integer,Map<Integer,String>>();

Map<Integer, String> linkedHashMap = Maps.newLinkedHashMap();
Map<Integer, String> linkedHashMap1 = Maps.newLinkedHashMap();

linkedHashMap.put(1, "a");
linkedHashMap.put(2, "b");
linkedHashMap.put(3, "c");
linkedHashMap.put(4, "d");

linkedHashMap1.put(11, "a1");
linkedHashMap1.put(22, "b2");
linkedHashMap1.put(33, "c3");
linkedHashMap1.put(44, "d4");

linkedHashMap.putAll(linkedHashMap1);

map.put(1, linkedHashMap);

}

}

上一篇:【CI3.1】CI框架简单使用方法


下一篇:hdu 1540 Tunnel Warfare 线段树 单点更新,查询区间长度,区间合并