2 ms·
It's this part: int i; { int i; } Java does not allow you to shadow one local variable with another. This is ok: { int i;
by finnw 15y ago
It's this part:
int i;
{
int i;
}
Java does not allow you to shadow one local variable with another.
This is ok:
{
int i;
}
int i;
because the scopes do not overlap.
This is ok too:
int i;
{
class LocalClass {
public void method() {
int i;
}
}
}