📜  java 用一行中的值初始化映射 - Java 代码示例

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

代码示例3
Map map = Stream.of(
  new AbstractMap.SimpleImmutableEntry<>("idea", 1),    
  new AbstractMap.SimpleImmutableEntry<>("mobile", 2))
  .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));