August 2024
Intermediate to advanced
988 pages
24h 37m
English
Compared to collections, streams provide a view of data that lets you specify computations at a higher conceptual level. With a stream, you specify what you want to have done, not how to do it. You leave the scheduling of operations to the implementation. For example, suppose you want to compute the average of a certain property. You specify the source of data and the property, and the stream library can then optimize the computation, for example by using multiple threads for computing sums and counts and combining the results.
In this chapter, you will learn how to use the Java stream library, which allows you to process sequences of values in a “what, not how” style.
When you process ...