This is the text I read in a computer science book from my college regarding scopes and variable declarations in Java:
The compiler will generate an error for this code:
int i=3; while (...) { int i=1; ... }
The first declaration of i is still in effect within the while loop, yielding overlapping scopes.
The clause that I am questioning is this "yielding overlapping scopes". The scopes are overlapping yes, but the problem is that there are overlapping variable declarations in overlapping scopes. The overlapping scopes isn't the problem per se right?