You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.out.println("Value of a before the block = " + a);
{
System.out.println("Value of a inside block = " + a);
// int a = 5; // BlockScopeEx1.java:8: error: variable a is already defined in method main(String[])
a = 10;
int b = 20;
System.out.println("Value of b inside block = " + b);
}
// System.out.println("Value of b outside the block = " + b); // BlockScopeEx1.java:15: error: cannot find symbol => symbol: variable b location: class BlockScopeEx1
System.out.println("Value of a after the block = " + a);