r/java • u/davidalayachew • Jan 06 '26
One step closer to Value Classes!
https://mail.openjdk.org/pipermail/porters-dev/2026-January/000844.html
181
Upvotes
r/java • u/davidalayachew • Jan 06 '26
View all comments
Show parent comment
6
u/koflerdavid Jan 06 '26
Kotlin has value classes, however, on the JVM backend it can only optimize one special case: value classes with a single property.
https://kotlinlang.org/docs/inline-classes.html
As soon as Project Valhalla lands, Kotlin will map its value classes to Java value classes.
https://github.com/Kotlin/KEEP/blob/master/notes/value-classes.md#project-valhalla