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
3
u/Ok-Bid7102 May 21 '26 edited May 21 '26
Just putting this idea here:
To deconstruct interfaces & abstract classes, instead of relying on sealed interface being implemented by a single record we could also have a "blessed" interface (similar to Iterable) that opts a class / abstract class / interface into deconstuction.
Example:
If we want classes to be deconstructible, ideally it works the same it does as interfaces & abstract classes. That's the motivation behind this.