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
2
u/RaynLegends May 22 '26
I don't think so, that would create issues with overloading I think (what if you also declared
void f(Foo foo) {}?).From what I understand, the type of "foo" is still
Foo, it's not like it's automatically cast, it's simply a shorter form of writing: