<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/jep-547-lazy-constants-fourth-preview--w8ft5fqr6" -->

---
title: JEP 547: Lazy Constants (Fourth Preview) | daily.dev
description: JEP 547 proposes a fourth preview of the Lazy Constants API for JDK 28, with no changes from the previous preview. Lazy constants, of type...
canonical: https://daily.dev/posts/jep-547-lazy-constants-fourth-preview--w8ft5fqr6
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: JEP 547: Lazy Constants (Fourth Preview) | daily.dev
og:description: JEP 547 proposes a fourth preview of the Lazy Constants API for JDK 28, with no changes from the previous preview. Lazy constants, of type...
og:url: https://daily.dev/posts/jep-547-lazy-constants-fourth-preview--w8ft5fqr6
og:image: https://api.daily.dev/og/posts/w8fT5FQR6.png
og:image:alt: JEP 547: Lazy Constants (Fourth Preview)
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# JEP 547: Lazy Constants (Fourth Preview)

**[Inside Java](https://daily.dev/sources/inside_java)** · 18 min read · 0 upvotes · 0 comments

## Summary

JEP 547 proposes a fourth preview of the Lazy Constants API for JDK 28, with no changes from the previous preview. Lazy constants, of type java.lang.LazyConstant, hold unmodifiable data that the JVM treats as true constants for constant-folding, while allowing initialization to be deferred rather than forced eagerly like final fields. The API, originally called StableValue, previewed first in JDK 25 (JEP 502), was renamed and reworked in JDK 26 (JEP 526) and JDK 27 (JEP 531), adding lazy versions of List, Set, and Map. It remains a preview feature requiring --enable-preview to use.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://inside.java/2026/11/20/jep547-target-jdk28>

## Questions this post answers

### What is java.lang.LazyConstant and how is it different from a final field?

LazyConstant is a preview API type in java.lang that holds a single unmodifiable value, initialized on demand via a computing function rather than eagerly like a final field. Unlike final fields, which must be set during construction or class initialization in textual order, a lazy constant can be initialized later while still being eligible for JVM constant-folding once set, provided it is stored in a final field.

_Tracking Java preview APIs like this gets easier when deprecations and JEP updates are surfaced on daily.dev._

### How do I enable preview features to use LazyConstant in JDK 26 or later?

Compile with 'javac --release 26 --enable-preview Main.java' and run with 'java --enable-preview Main'. Alternatively, use the source code launcher with 'java --enable-preview Main.java', or start jshell with 'jshell --enable-preview'. This is required because LazyConstant remains a preview API, not enabled by default.

_Developers adopting preview JDK features often check daily.dev before locking in a build flag that might change._

### What was the API for lazy constants called before it was renamed to LazyConstant?

It was originally called StableValue when it first previewed in JDK 25 via JEP 502. It was renamed to LazyConstant in JDK 26 via JEP 526, along with other changes such as removing low-level methods like orElseSet, setOrThrow, and trySet, and moving lazy list and map factory methods into java.util.List and java.util.Map.

_Following a renamed API across JDK previews is exactly the kind of churn daily.dev helps developers keep up with._

## Similar posts on daily.dev

- [JEP 526: Lazy Constants \(Second Preview\)](https://daily.dev/posts/jep-526-lazy-constants-second-preview--plio8y3uu) · Inside Java · 1 upvotes · 0 comments
- [JEP 526 - Stable Values Become Lazy Constants](https://daily.dev/posts/jep-526---stable-values-become-lazy-constants-8o5dxtmjs) · SoftwareMill · 0 upvotes · 0 comments
- [JEP 526 Simplifies Deferred Initialization Ahead of JDK 26](https://daily.dev/posts/jep-526-simplifies-deferred-initialization-ahead-of-jdk-26-gpocqrfgk) · InfoQ · 0 upvotes · 0 comments
- [Inside Java Newscast \#106 – Inside.java](https://daily.dev/posts/inside-java-newscast-106-inside-java-vyaaexskr) · Inside Java · 1 upvotes · 0 comments

---

Tags: [#java](https://daily.dev/tags/java), [#jvm](https://daily.dev/tags/jvm)

[View this post on daily.dev](https://daily.dev/posts/jep-547-lazy-constants-fourth-preview--w8ft5fqr6)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"JEP 547: Lazy Constants (Fourth Preview)","url":"https://daily.dev/posts/jep-547-lazy-constants-fourth-preview--w8ft5fqr6","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/jep-547-lazy-constants-fourth-preview--w8ft5fqr6"},"datePublished":"2026-11-20T08:44:20.321Z","dateModified":"2026-11-20T08:44:49.975Z","description":"JEP 547 proposes a fourth preview of the Lazy Constants API for JDK 28, with no changes from the previous preview. Lazy constants, of type...","image":"https://media.daily.dev/image/upload/s--qPvKM23u--/f_auto/v1722860399/public/Placeholder%2009","thumbnailUrl":"https://media.daily.dev/image/upload/s--qPvKM23u--/f_auto/v1722860399/public/Placeholder%2009","isAccessibleForFree":true,"articleSection":"Inside Java","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Inside Java","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/de5992d95f374790bdfd2ae03a16f6e3","url":"https://daily.dev/sources/inside_java"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/jep-547-lazy-constants-fourth-preview--w8ft5fqr6","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,jvm","timeRequired":"PT18M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Inside Java","item":"https://daily.dev/sources/inside_java"},{"@type":"ListItem","position":3,"name":"JEP 547: Lazy Constants (Fourth Preview)"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/jep-547-lazy-constants-fourth-preview--w8ft5fqr6#faq","mainEntity":[{"@type":"Question","name":"What is java.lang.LazyConstant and how is it different from a final field?","acceptedAnswer":{"@type":"Answer","text":"LazyConstant is a preview API type in java.lang that holds a single unmodifiable value, initialized on demand via a computing function rather than eagerly like a final field. Unlike final fields, which must be set during construction or class initialization in textual order, a lazy constant can be initialized later while still being eligible for JVM constant-folding once set, provided it is stored in a final field. Tracking Java preview APIs like this gets easier when deprecations and JEP updates are surfaced on daily.dev."}},{"@type":"Question","name":"How do I enable preview features to use LazyConstant in JDK 26 or later?","acceptedAnswer":{"@type":"Answer","text":"Compile with 'javac --release 26 --enable-preview Main.java' and run with 'java --enable-preview Main'. Alternatively, use the source code launcher with 'java --enable-preview Main.java', or start jshell with 'jshell --enable-preview'. This is required because LazyConstant remains a preview API, not enabled by default. Developers adopting preview JDK features often check daily.dev before locking in a build flag that might change."}},{"@type":"Question","name":"What was the API for lazy constants called before it was renamed to LazyConstant?","acceptedAnswer":{"@type":"Answer","text":"It was originally called StableValue when it first previewed in JDK 25 via JEP 502. It was renamed to LazyConstant in JDK 26 via JEP 526, along with other changes such as removing low-level methods like orElseSet, setOrThrow, and trySet, and moving lazy list and map factory methods into java.util.List and java.util.Map. Following a renamed API across JDK previews is exactly the kind of churn daily.dev helps developers keep up with."}}]}
```

