Joe Soltzberg

51%
Flag icon
The forEach operation should be used only to report the result of a stream computation, not to perform the computation. Occasionally, it makes sense to use forEach for some other purpose, such as adding the results of a stream computation to a preexisting collection.
Joe Soltzberg
If you struggle to build a functional stream for a given problem and are having to resort to a forEach, then it's usually either: 1. Not enough functional skills to tackle the problem 2. It could be done more cleanly using an iterative style
Effective Java
Rate this book
Clear rating
Open Preview