CHAPTER 13

image

Streams

In this chapter, you will learn

  • What streams are
  • Differences between collections and streams
  • How to create streams from different types of data sources
  • How to represent an optional value using the Optional class
  • Applying different types of operations on streams
  • Collecting data from streams using collectors
  • Grouping and partitioning a stream’s data
  • Finding and matching data in streams
  • How to work with parallel streams

What Is a Stream?

An aggregate operation computes a single value from a collection of values. The result of an aggregate operation may be simply a primitive value, an object, or a void. Note that an object may ...

Get Beginning Java 8 Language Features: Lambda Expressions, Inner Classes, Th reads, I/O, Collections,and Streams now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.