Hashmap with Streams in Java 8 Streams to collect value of Map

后端 未结 6 1846
悲&欢浪女
悲&欢浪女 2021-01-30 19:59

Let consider a hashmap

Map id1 = new HashMap();

I inserted some values into both hashmap.

For

6条回答
  •  猫巷女王i
    2021-01-30 20:28

    Maybe the sample is oversimplified, but you don't need the Java stream API here. Just use the Map directly.

     List list1 = id1.get(1); // this will return the list from your map
    

提交回复
热议问题