Skip to content
Tagged articles

final keyword

5 articles · Page 1 of 1
samdeepthink
samdeepthink
Sep 21, 2026 · Fundamentals

Java final Visibility: JMM Freeze, This Escape, and Lock-Free Guarantees

This article explains how Java's final keyword ensures cross-thread visibility of final fields through the JMM's freeze action at constructor end, provided the this reference does not escape during construction, demonstrating with a code example that shows a race condition when this escapes and the correct behavior when final fields are properly frozen.

ConcurrencyJMMJava
0 likes · 7 min read
Java final Visibility: JMM Freeze, This Escape, and Lock-Free Guarantees
Cognitive Technology Team
Cognitive Technology Team
Oct 6, 2023 · Fundamentals

Understanding the final Keyword in Java

The article explains Java's final keyword, detailing its three distinct uses—modifying variables, methods, and classes—while describing how final variables become immutable constants, final methods cannot be overridden, and final classes cannot be subclassed, illustrating each case with examples.

ClassesJavafinal keyword
0 likes · 3 min read
Understanding the final Keyword in Java