Pages

Topics

Tools

↑↓navigate↵openescclose

Java guides

Every published Java guide, newest first, with practical examples you can copy into your own project.

3,965 guides across 14 topics

Topics

Latest Java guides

Diagram comparing sequential stream processing on a single thread with parallel stream processing split across multiple threads in a fork-join pool.
Java

Java Stream vs ParallelStream: Choosing the Right Pipeline

Understand when parallelStream actually improves performance and when it adds overhead. Covers splitting, ForkJoinPool behavior, and decision criteria.

Java StreamsParallel ProcessingForkJoinPoolPerformance
Diagram showing a Java stream splitting into parallel branches processed by multiple threads.
Java

Java Parallel Stream: When and How to Use It

java parallel stream: Learn how Java parallel streams work, when they improve performance, and avoid common concurrency pitfalls like thread safety and ordering.

parallel streamsjava streamsfork-join poolconcurrency
A single orderly line of data elements flowing through a processing funnel, representing a Java sequential stream.
Java

Java Sequential Stream: How the Default Stream Mode Works

Understand how Java sequential streams process elements, when to use them instead of parallel streams, and how the default Stream API mode works.

JavaStream APIFunctional ProgrammingCollections
Illustration of a Java stream being closed and throwing an error, with a fix showing a supplier creating a new stream.
Java

Java Stream Closed Error: How to Fix It

Learn why a Java stream throws 'stream has already been operated upon or closed' after a terminal operation, and how to avoid it with suppliers or by collecting results.

Java StreamsIllegalStateExceptionStream ReuseFunctional Programming
Illustration of a one-way stream pipeline that cannot be replayed, with a single-use arrow and a fresh stream being created from the same source.
Java

Java Stream Reuse: Why Streams Are Single-Use

java stream reuse: Java streams are single-use by design. Learn why reuse throws IllegalStateException, and how to replay pipelines with Supplier or materialize result...

Java StreamsStream APISupplierFunctional Programming
Diagram showing a Java stream pipeline with lazy intermediate operations and a terminal operation triggering execution.
Java

Java Stream Lazy Evaluation Explained

Understand how Java Streams defer computation until a terminal operation is called, and how lazy evaluation affects performance, short-circuiting, and side effects.

Java StreamsLazy EvaluationStream APIFunctional Programming
Diagram showing a Java stream pipeline with lazy intermediate operation stages flowing into an eager terminal operation that produces a final result.
Java

Java Intermediate vs Terminal Operations Explained

Understand how Java Streams distinguish lazy intermediate operations from eager terminal operations and how that affects pipeline execution.

Java StreamsStream APIFunctional ProgrammingLazy Evaluation
Diagram illustrating Java Stream terminal operations triggering data processing pipeline
Java

Java Stream Terminal Operations: How They Work

java stream terminal operations: Understand Java Stream terminal operations, how they trigger pipeline execution, and how to choose the right one for your data process...

Java StreamsTerminal OperationsStream APIFunctional Programming
A visual metaphor of a Java stream pipeline showing intermediate operations as filters and transformers between source and result.
Java

Java Stream Intermediate Operations Explained

Java stream intermediate operations work lazily and return new streams. This article explains lazy evaluation, stateful vs stateless behavior, operation order, and performance trade-offs.

java streamsintermediate operationsfunctional programminglambda expressions
Illustration of Java stream noneMatch checking elements against a predicate with short-circuit behavior.
Java

Java Stream noneMatch: Syntax and Short-Circuiting

Learn how to use Java Stream.noneMatch to validate collections, understand its short-circuit behavior, and see practical code examples.

Java StreamsnoneMatchShort-circuitPredicate