阅读背景:

如何在Java 8 stream forEach中使用if-else逻辑

来源:互联网 

What I want to do is shown below in 2 stream calls. I want to split a collection into 2 new collections based on some condition. Ideally I want to do it in 1. I've seen conditions used for the .map function of streams, but couldn't find anything for the forEach. What is the best way to achieve what I want?What I want to do is shown below in 2 stream ca




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: