Why is it that curly braces do not define a separate local scope in Java? I was expecting this to be a feature common to the main curly brace languages (C, C++, Java, C#).<
Local variable shadowing is prohibited in Java on purpose (see this answer). The idea is that this helps decreasing bugs.