Tag

JDK8

1 views collected around this technical thread.

Java Tech Enthusiast
Java Tech Enthusiast
Mar 4, 2025 · Fundamentals

Java 8 Map API Enhancements

Java 8 enriches the Map interface with default methods such as getOrDefault, forEach, merge, putIfAbsent, compute, computeIfAbsent, computeIfPresent and replace, allowing developers to retrieve values with fallbacks, iterate entries, combine or conditionally update entries, and thus write more concise, readable code with far less boilerplate.

APICollectionsJDK8
0 likes · 9 min read
Java 8 Map API Enhancements
macrozheng
macrozheng
Nov 14, 2024 · Backend Development

Master Java’s New Map Methods: getOrDefault, forEach, merge & More

Learn how Java 8 introduced powerful Map methods such as getOrDefault, forEach, merge, putIfAbsent, compute, computeIfAbsent, computeIfPresent, and replace, with clear code examples that show how they simplify common tasks like default value handling, iteration, merging entries, and conditional updates.

Code TutorialJDK8Java
0 likes · 10 min read
Master Java’s New Map Methods: getOrDefault, forEach, merge & More
Architecture Digest
Architecture Digest
Oct 31, 2024 · Backend Development

Java 8 Map New Methods: getOrDefault, forEach, merge, putIfAbsent, compute, computeIfAbsent, computeIfPresent, replace

This article introduces the Java 8 Map API enhancements—including getOrDefault, forEach, merge, putIfAbsent, compute, computeIfAbsent, computeIfPresent, and replace—explaining their purpose, showing concise code examples, and demonstrating how they simplify common map‑handling scenarios.

CollectionsJDK8Java
0 likes · 9 min read
Java 8 Map New Methods: getOrDefault, forEach, merge, putIfAbsent, compute, computeIfAbsent, computeIfPresent, replace
Selected Java Interview Questions
Selected Java Interview Questions
Dec 2, 2023 · Backend Development

Understanding HashMap Resize Behavior and the Revision from Expansion Count to Resize Count in Alibaba's Developer Manual

This article explains the recent correction in Alibaba's developer manual that replaces the ambiguous "expansion count" of HashMap with the precise "resize count", details the conditions under which HashMap triggers resize during the first put operation, and shows why storing 1024 elements in JDK 1.8 results in eight resize calls.

Data StructuresHashMapJDK8
0 likes · 9 min read
Understanding HashMap Resize Behavior and the Revision from Expansion Count to Resize Count in Alibaba's Developer Manual
Java Architect Essentials
Java Architect Essentials
Nov 22, 2023 · Information Security

Apache ActiveMQ Remote Code Execution Vulnerability and Mitigation for JDK8/Docker Environments

The article explains the critical remote code execution vulnerability discovered in Apache ActiveMQ, lists the affected and safe versions, and provides practical mitigation steps—including upgrading, network restrictions, and a custom Docker image for JDK8 users—to protect systems from exploitation.

Apache ActiveMQDockerJDK8
0 likes · 4 min read
Apache ActiveMQ Remote Code Execution Vulnerability and Mitigation for JDK8/Docker Environments
JD Tech
JD Tech
May 15, 2023 · Backend Development

Implementing Asynchronous Timeout with CompletableFuture in Java (JDK 8 & JDK 9)

This article explains how to use Java's CompletableFuture for parallel execution, demonstrates the limitations of simple timeout handling in JDK 8, and shows how JDK 9's built‑in orTimeout method and a custom utility class can provide precise asynchronous timeout control for backend services.

Async TimeoutCompletableFutureJDK8
0 likes · 12 min read
Implementing Asynchronous Timeout with CompletableFuture in Java (JDK 8 & JDK 9)
Selected Java Interview Questions
Selected Java Interview Questions
May 30, 2022 · Backend Development

Understanding Java ConcurrentHashMap: Implementation, Locking, and Performance

This article explains the shortcomings of HashMap, compares Hashtable, synchronizedMap, and ConcurrentHashMap implementations in JDK 7 and JDK 8, discusses lock states, fail‑fast vs fail‑safe behavior, and provides code examples and optimization tips for thread‑safe map operations.

ConcurrentHashMapJDK7JDK8
0 likes · 12 min read
Understanding Java ConcurrentHashMap: Implementation, Locking, and Performance
macrozheng
macrozheng
May 9, 2022 · Backend Development

Master Java Date & Time: From JDK7 Date to JDK8 LocalDate/LocalDateTime

This article compares Java's legacy date handling in JDK7 with the modern java.time API introduced in JDK8, demonstrating how to create, format, and convert dates using LocalDate, LocalDateTime, DateTimeFormatter, and related methods, and provides a comprehensive table of useful LocalDate APIs.

DateTimeJDK8Java
0 likes · 9 min read
Master Java Date & Time: From JDK7 Date to JDK8 LocalDate/LocalDateTime
Sanyou's Java Diary
Sanyou's Java Diary
Feb 26, 2022 · Fundamentals

How JDK 1.8 Optimizes HashMap Rehashing: Inside the Resize Algorithm

This article explains the JDK 1.8 HashMap resize/re‑hash optimization, showing how the new algorithm splits buckets instead of re‑hashing every entry, and includes the full source code and visual illustrations for single nodes, linked lists, and red‑black trees.

Data StructuresHashMapJDK8
0 likes · 8 min read
How JDK 1.8 Optimizes HashMap Rehashing: Inside the Resize Algorithm
Top Architect
Top Architect
Feb 9, 2022 · Backend Development

Deep Dive into Java CompletableFuture: Implementation, Usage, and Internal Mechanics

This article provides an in‑depth analysis of Java’s CompletableFuture introduced in JDK 8, explaining its motivations, core methods, internal mechanisms such as asyncSupplyStage, thenAcceptAsync, and postComplete, and includes practical code examples to illustrate asynchronous task handling and dependency management.

CompletableFutureJDK8Java
0 likes · 13 min read
Deep Dive into Java CompletableFuture: Implementation, Usage, and Internal Mechanics
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Oct 14, 2021 · Fundamentals

Analyzing the Dead Loop Issue in JDK 1.7 HashMap and Its Resolution in JDK 1.8

This article explains why the pre‑JDK 1.8 HashMap can enter an infinite loop during concurrent resizing, illustrates the problem with detailed step‑by‑step diagrams, and shows how JDK 1.8 redesigns the resize algorithm to prevent the loop.

DataStructuresDeadLoopHashMap
0 likes · 5 min read
Analyzing the Dead Loop Issue in JDK 1.7 HashMap and Its Resolution in JDK 1.8
macrozheng
macrozheng
Aug 27, 2021 · Backend Development

Master Java 8 Optional and Lambda: Reduce Null Checks and Write Cleaner Code

This tutorial explains how Java 8's Optional class and lambda expressions simplify null handling and collection processing, offering concise code examples, method summaries, and a clear comparison with Java 7 approaches to improve readability and development efficiency.

Functional ProgrammingJDK8Java
0 likes · 8 min read
Master Java 8 Optional and Lambda: Reduce Null Checks and Write Cleaner Code
Selected Java Interview Questions
Selected Java Interview Questions
Aug 1, 2021 · Backend Development

Ways to Create Thread Pools in JDK 1.8

This article introduces the various thread pool creation methods available in JDK 1.8—including fixed, cached, scheduled, single, single‑scheduled, and work‑stealing executors—explains their characteristics, provides sample Java code for each, and shows typical execution results.

ExecutorServiceJDK8Java
0 likes · 10 min read
Ways to Create Thread Pools in JDK 1.8
Top Architect
Top Architect
Mar 15, 2021 · Fundamentals

Analysis of JDK 1.8 HashMap Implementation Compared to JDK 1.7

This article explains the major differences between JDK 1.8 and JDK 1.7 HashMap implementations, detailing the initialization process, the putVal algorithm steps, how collisions are handled with linked lists and red‑black trees, and the changes in resizing behavior.

CollectionsData StructuresHashMap
0 likes · 5 min read
Analysis of JDK 1.8 HashMap Implementation Compared to JDK 1.7
Top Architect
Top Architect
Mar 11, 2021 · Fundamentals

Why ConcurrentHashMap.get() in Java 8 Is Lock‑Free

This article explains how Java 8's ConcurrentHashMap implements the get operation without acquiring locks by using volatile fields, CAS, and a simplified node structure, contrasting it with the segment‑based design of JDK 1.7 and detailing the memory‑visibility guarantees provided by volatile.

ConcurrentHashMapJDK8Java
0 likes · 9 min read
Why ConcurrentHashMap.get() in Java 8 Is Lock‑Free
Selected Java Interview Questions
Selected Java Interview Questions
Mar 4, 2021 · Backend Development

Understanding ThreadPoolExecutor Worker Thread Recycling in JDK 1.8

This article explains how ThreadPoolExecutor in JDK 1.8 recycles worker threads by analyzing the runWorker loop, the conditions under which getTask() returns null, and the different scenarios of thread termination with and without invoking shutdown(), illustrating the role of CAS and interrupt handling.

JDK8JavaThread Recycling
0 likes · 11 min read
Understanding ThreadPoolExecutor Worker Thread Recycling in JDK 1.8