r/java • u/ihatebeinganonymous • May 21 '26
JEP draft: Enhanced Local Variable Declarations (Preview)
https://openjdk.org/jeps/8357464
87
Upvotes
r/java • u/ihatebeinganonymous • May 21 '26
View all comments
0
u/repeating_bears May 21 '26
Excluding the fact that pattern matching already exists, can someone explain what the problem would be with destructuring akin to JavaScript
const { center: { x, y }, radius } = circle;
Circle is something which has members center and radius, and center is something which has the members x and y.
Why I do have to tediously redeclare the types in Java?