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 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.