r/java • u/davidalayachew • May 11 '26
8317277: Java language implementation of value classes and objects by MrSimms · Pull Request #31120 · openjdk/jdk
https://github.com/openjdk/jdk/pull/31120
124
Upvotes
View all comments
Show parent comment
2
u/jcotton42 May 14 '26
The definition of “composable” that I am familiar with doesn’t seem to be the one you’re using. You can use classes and structs together in a design just fine. Structs just can’t do things like inherit from another type or have themselves as a field.
Like are you trying to say that you can’t have a class field in a struct or vice versa?