Processing Data in Memory
The Stream API is probably the second most important feature added to Java...所以不得不设计一套Stream API来支持map-filter-reduce。...System.out.println("flatMap = " + flatMap);
concat = [1, 2, 3, 4, 5, 6]
flatMap = [1, 2, 3, 4, 5, 6, 7, 8, 9]
连接流,推荐使用...要想reduce stream,还有其他更多方法,比如count()、sum()等。....sum();
参考资料:
The Stream API https://dev.java/learn/api/streams/