📜  java 字典初始化 - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:36.763000             🧑  作者: Mango

代码示例1
Map> adjList = Stream.of(
            new SimpleEntry<>("Edmonton", Arrays.asList("E N1", "E N2", "E N3")), 
            new SimpleEntry<>("Vancouver", Arrays.asList("V N1", "V N2", "V N3")))
            .collect(Collectors.toMap((e) -> e.getKey(), (e) -> e.getValue()));