17.2.3 Streams

Java SE 8 introduces the concept of streams, which are similar to the iterators you learned in Chapter 16. Streams are objects of classes that implement interface Stream (from the package java.util.stream) or one of the specialized stream interfacess for processing collections of int, long or double values (which we introduce in Section 17.3). Together with lambdas, streams enable you to perform tasks on collections of elements—often from an array or collection object.

Stream Pipelines

Streams move elements through a sequence of processing steps—known as a stream pipeline—that begins with a data source (such as an array or collection), performs various intermediate operations on the data source’s elements and ends with a terminal ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.