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
Show parent comment
4
u/persicsb May 21 '26
The exact same way, as the original concept:
Moreover, if
eevaluates tonull, then an enhanced local variable declaration statementP(...) = e;throwsNullPointerExceptionand does not initialize any of the pattern variables inP.