<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/quality-outreach-heads-up---jdk-28-value-classes-j9tiziys2" -->

---
title: Quality Outreach Heads-up - JDK 28: Value Classes
description: JDK 28 introduces value classes as a preview feature under JEP 401, and with preview features enabled, 30 JDK classes become value classes, including Integer,...
canonical: https://daily.dev/posts/quality-outreach-heads-up---jdk-28-value-classes-j9tiziys2
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Quality Outreach Heads-up - JDK 28: Value Classes | daily.dev
og:description: JDK 28 introduces value classes as a preview feature under JEP 401, and with preview features enabled, 30 JDK classes become value classes, including Integer,...
og:url: https://daily.dev/posts/quality-outreach-heads-up---jdk-28-value-classes-j9tiziys2
og:image: https://api.daily.dev/og/posts/J9TiZiYs2.png
og:image:alt: Quality Outreach Heads-up - JDK 28: Value Classes
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.

# Quality Outreach Heads-up - JDK 28: Value Classes

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

## Summary

JDK 28 introduces value classes as a preview feature under JEP 401, and with preview features enabled, 30 JDK classes become value classes, including Integer, Double, Optional, and the java.time types. Value classes lack identity, so '==' may now return true for instances that previously compared unequal. They also can't be synchronized on, can't be used with java.lang.ref or WeakHashMap, and reject setAccessible on their fields. Enabling preview features at compile time also imposes new 'early construction' rules on record constructors that can introduce compile errors. Projects are asked to test their code against JDK 28 with preview features both disabled and enabled, and report unexpected issues to the valhalla-dev mailing list.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://inside.java/2026/10/27/quality-heads-up>

## Questions this post answers

### Which JDK classes become value classes when preview features are enabled in JDK 28?

30 JDK classes become value classes under JEP 401 in JDK 28, including java.lang's Integer, Long, Float, Double, Byte, Short, Character, Boolean, Number, and Record; java.util's Optional, OptionalInt, OptionalLong, OptionalDouble; the java.time types like LocalDate and Duration; and java.time.chrono date classes like HijrahDate and JapaneseDate.

_Teams planning a JDK 28 upgrade can track value-class compatibility changes like these on daily.dev._

### Why would == suddenly return true for two separate Integer or LocalDate objects after enabling preview features in JDK 28?

Because these classes become value classes, which lack identity, so '==' compares them by field values instead of object identity. For example, two separately constructed LocalDate.of(2026, 7, 31) instances that previously compared unequal with '==' will now compare equal once preview features making them value classes are enabled in JDK 28.

_Developers debugging identity-sensitive comparisons can follow changes like this on daily.dev before they ship._

### Why does my record's compact constructor fail to compile under JDK 28 preview features?

Enabling preview features imposes 'early construction' rules on record constructors, restricting interaction with 'this' to field assignments until super() or this(...) is called. Statements that call instance methods or otherwise expose the under-construction instance now cause compile errors; fixes include removing the statement, rewriting it for the early-construction context, or moving it after field assignment and the super()/this() call.

_Java developers hitting new preview-mode compile errors can track fixes like this via daily.dev._

## Similar posts on daily.dev

- [JEP 401: Value Objects \(Preview\)](https://daily.dev/posts/jep-401-value-objects-preview--1rxfjujqr) · Inside Java · 2 upvotes · 0 comments
- [Java’s biggest language change in a decade is finally landing. It took 197,000 lines of code.](https://daily.dev/posts/java-s-biggest-language-change-in-a-decade-is-finally-landing-it-took-197-000-lines-of-code--8eeespmnb) · The Next Web · 39 upvotes · 1 comments
- [Valhalla, Now\!](https://daily.dev/posts/valhalla-now--aua4ibtem) · nipafx \(Nicolai Parlog\) · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/quality-outreach-heads-up---jdk-28-value-classes-j9tiziys2)

```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":"Quality Outreach Heads-up - JDK 28: Value Classes","url":"https://daily.dev/posts/quality-outreach-heads-up---jdk-28-value-classes-j9tiziys2","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/quality-outreach-heads-up---jdk-28-value-classes-j9tiziys2"},"datePublished":"2026-10-27T07:31:17.100Z","dateModified":"2026-10-30T22:48:15.163Z","description":"JDK 28 introduces value classes as a preview feature under JEP 401, and with preview features enabled, 30 JDK classes become value classes, including Integer,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8a590c6abfe6299c110ce5c325f2383e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/8a590c6abfe6299c110ce5c325f2383e?_a=AQAEuop","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/quality-outreach-heads-up---jdk-28-value-classes-j9tiziys2","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"java,jdk","timeRequired":"PT5M"}
{"@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":"Quality Outreach Heads-up - JDK 28: Value Classes"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/quality-outreach-heads-up---jdk-28-value-classes-j9tiziys2#faq","mainEntity":[{"@type":"Question","name":"Which JDK classes become value classes when preview features are enabled in JDK 28?","acceptedAnswer":{"@type":"Answer","text":"30 JDK classes become value classes under JEP 401 in JDK 28, including java.lang's Integer, Long, Float, Double, Byte, Short, Character, Boolean, Number, and Record; java.util's Optional, OptionalInt, OptionalLong, OptionalDouble; the java.time types like LocalDate and Duration; and java.time.chrono date classes like HijrahDate and JapaneseDate. Teams planning a JDK 28 upgrade can track value-class compatibility changes like these on daily.dev."}},{"@type":"Question","name":"Why would == suddenly return true for two separate Integer or LocalDate objects after enabling preview features in JDK 28?","acceptedAnswer":{"@type":"Answer","text":"Because these classes become value classes, which lack identity, so '==' compares them by field values instead of object identity. For example, two separately constructed LocalDate.of(2026, 7, 31) instances that previously compared unequal with '==' will now compare equal once preview features making them value classes are enabled in JDK 28. Developers debugging identity-sensitive comparisons can follow changes like this on daily.dev before they ship."}},{"@type":"Question","name":"Why does my record's compact constructor fail to compile under JDK 28 preview features?","acceptedAnswer":{"@type":"Answer","text":"Enabling preview features imposes 'early construction' rules on record constructors, restricting interaction with 'this' to field assignments until super() or this(...) is called. Statements that call instance methods or otherwise expose the under-construction instance now cause compile errors; fixes include removing the statement, rewriting it for the early-construction context, or moving it after field assignment and the super()/this() call. Java developers hitting new preview-mode compile errors can track fixes like this via daily.dev."}}]}
```

