JEP 526 renames Java's Stable Values feature to Lazy Constants, introducing the LazyConstant<T> container as a preview feature in Java 26. A LazyConstant holds a single value that becomes immutable once set, enabling lazy initialization without sacrificing JVM optimizations like constant folding. Key changes from Java 25
Table of contents
What are Lazy ConstantsBefore Lazy ConstantsLet's use some Lazy ConstantsWhat has changed in Java 26?Potential issuesWhat is the goal of this JEP?Sort: