Java SE 8

The for statement and the enhanced for statement each iterate sequentially from a starting value to an ending value. In Chapter 17, Java SE 8 Lambdas and Streams, you’ll learn about class Stream and its forEach method. Working together, these provide an elegant, more concise and less error prone means for iterating through collections so that some of the iterations may occur in parallel with others to achieve better multi-core system performance.

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.