V
visionset
Why did they decide to restrict the variable scope for enhanced for loops?
It is handy sometimes to have the extra scope.
This won't compile:
String[] strings = {"foo"};
String str;
for (str : strings) {}
It is handy sometimes to have the extra scope.
This won't compile:
String[] strings = {"foo"};
String str;
for (str : strings) {}