O'Reilly logo

Learning Java Functional Programming by Richard M Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Stream and concurrent processing

All stream operations execute either sequentially or in parallel. They execute sequentially by default. To execute concurrently, a parallel stream must be created. The Stream class uses a parallel method, and the Collection interface uses a parallelStream method to create parallel streams.

The typical iterative loop in Java (such as the for or while loops) are serial in nature. That is, they are designed to execute sequentially and are not able to easily incorporate concurrent behavior.

Over the years, Java has introduced a number of improvements in how parallel behavior can be achieved. Each of these improvements has built upon the thread concept and frequently addresses specific concurrent approaches such as thread ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required