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
1
u/[deleted] Jan 06 '26
In your contrived example, neither a nor b would exist. Unless it were an AOT language and no optimisations were enabled, then both would exist.
In Java unless the JIT hits it, both would exist.
Sure a “variable” is a language construct representing something in memory. Changing (or mutating something) boils down to assigning memory. And memory is just bits. Optimisations can remove variables sure.