Back to Java

Streams

Functional-style data processing with the Java Stream API.

Java Streams

The Java Stream API enables expressive, functional-style processing of collections and data sources. Streams support operations such as map, filter, reduce, collect, and parallel execution.

Key Concepts

  • Stream creation from collections, arrays, and I/O sources
  • Intermediate operations: map, filter, flatMap, sorted
  • Terminal operations: collect, forEach, reduce, count
  • Lazy evaluation and pipeline optimization
  • Parallel streams for concurrent processing

Streams are a core part of modern Java, especially for working with collections, data transformation, and concurrent pipelines.

Java Streams Cheat Sheet