Processing Collections with Java Streams
Understanding Streams in Java
Introduction and Stream Utility
Consider a scenario where you need to filter and process a collection of strings. Given a list of names, the task are: extract names starting with a specific prefix, further filter those by length, and finally display the results.
Example using a traditional approach:
import java.uti ...
Posted on Thu, 10 Sep 2026 16:12:52 +0000 by jemrys
Techniques for Replacing Elements in Java Collections
Using the Collections Class to Replace Elements in a Collection
The Collections class is part of the Java Collections Framework and provides numerous static methods for manipulating or returning collection objects. However, the Collections class does not offer a direct method to replace all elements in a collection. You can achieve this by usin ...
Posted on Sun, 09 Aug 2026 16:08:06 +0000 by shoz
Understanding Lambda Expressions in Modern Java
Java 8 introduced lambda expressions as a foundational shift toward functional programming within the language. By enabling developers to pass behavior as data, lambdas eliminate the verbosity of anonymous inner classes and streamline operations that require inline function definitions.
Core Syntax and Structure
The fundamental anatomy of a lam ...
Posted on Fri, 17 Jul 2026 16:12:31 +0000 by GetPutDelete
Java 8: Key Features and Functional Programming Enhancements
Java 8: Key Features and Functional Programming Enhancements
Java 8 (also known as JDK 1.8) represents a significant release in the evolution of the Java programming language. Released by Oracle on March 18, 2014, this version introduced functional programming capabilities, a new JavaScript engine, an enhanced date-time API, and the Stream API ...
Posted on Wed, 08 Jul 2026 17:20:38 +0000 by judgy
Collection Iteration Techniques in Java
Collection iteration refers to the process of accessing each element within a collection and performing operations on them. The Java Collections Framework provides multiple approaches for traversing collections.
Traditional Index-Based Loop
For List implementations, the classic index-based for loop remains a viable option:
List<String> it ...
Posted on Wed, 01 Jul 2026 17:20:06 +0000 by deeem
Working with Java Streams for Data Processing
Streams in Java provide a functional appproach to processing sequences of elements, such as collections or arrays. They support operations like filtering, mapping, and reducing through a pipeline of intermediate and terminal operations, leading to more concise and efficient code.
Instantiating Streams
From a List
A stream can be created from a ...
Posted on Sun, 28 Jun 2026 17:29:04 +0000 by Yanayaya
Transforming Intermediate Stream Types in Java: IntStream, Stream<Integer>, OptionalInt, and Optional<Integer>
IntStream and Stream<Integer> often appear as intermediate phases when working with numeric data in the Java Stream API. Terminal operations like sum, average, min, or max typically yield OptionalInt or Optional<Integer> to safely handle potentially missing values. Understanding how to create these streams, convert b ...
Posted on Mon, 15 Jun 2026 16:25:22 +0000 by Janjan
Core JDK 8–17 Enhancements: Lambda Expressions, Stream API, and LTS Fundamentals
Java Release Cycle and Version Context
Cadence Shifts and LTS Strategy
JDK 8 (March 2014) marked the last feature-driven major release before Oracle shifted to a strict 6-month time-based cadence starting with JDK 9 (September 2017). This change unblocks Java/JVM evolution by decoupling releases from large, high-risk feature bundles. For enterp ...
Posted on Tue, 26 May 2026 18:51:30 +0000 by sharke
Mastering Java Stream API for Clean and Efficient Code
Java Stream API introduced in JDK8 brings functional programmming to Java, enabling declarative data processing for cleaner and more efficient code.
Key Stream Characteristics
Not a data structure, no internal storage
No index-based access
Lazy evaluation
Parallel processing support
Easy conversion to arrays/collections
Supports filtering, map ...
Posted on Mon, 25 May 2026 16:51:14 +0000 by PHPfolife
Harnessing Multi-Core Performance with Java Stream Parallelism
The introduction of the Stream API in Java 8 revolutionized data manipulation by providing a declarative approach to processing collections. Among its features, parallel execution stands out as a mechanism to leverage modern multi-core architectures. By partitioning data and distributing work across multiple threads, parallel streams can dramat ...
Posted on Fri, 15 May 2026 13:38:37 +0000 by ether