JDK 26 introduces JEP 526, which previews LazyConstant — a new Java type that lazily initializes a value via a Supplier, executes that supplier at most once successfully, and stores the result in a @Stable-annotated field to enable constant folding. This addresses the error-prone nature of manual lazy initialization patterns in
Table of contents
Additional resourcesSort: