Skip to Content
Core Java, Volume II: Advanced Features, 13th Edition
book

Core Java, Volume II: Advanced Features, 13th Edition

by Cay S. Horstmann
August 2024
Intermediate to advanced content levelIntermediate to advanced
988 pages
24h 37m
English
Pearson
Content preview from Core Java, Volume II: Advanced Features, 13th Edition

Chapter 1 ▪ Streams

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.

1.1. From Iterating to Stream Operations

When you process ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Core Java, Volume I: Fundamentals, 13th Edition

Core Java, Volume I: Fundamentals, 13th Edition

Cay S. Horstmann

Publisher Resources

ISBN: 9780135371671