Hi,
Can anyone explain me why the following code gives comple time error ?
public class ScopeTest {
private int i;
public void testMethod() {
int i=10;
{
int i = 12; //Compile time Error. Variable i already defined in the scope.
}
}
}
I am not able to understand clearly the scope rules ?
Thanks in advance,