@@ -0,0 +1,440 @@
+// Demonstrate block scope.%0Aclass ScopeDemo %7B%0A%09public static void main(String args%5B%5D) %7B%0A%09%09int x; // known to all code within main%0A%09%09%0A%09%09x = 10;%0A%09%09if(x == 10) %7B // start new scope%0A%09%09%09%0A%09%09%09int y = 20; // known only to this block%0A%09%09%09%0A%09%09%09// x and y both known here.%0A%09%09%09System.out.println(%22x and y: %22 + x + %22 %22 + y);%0A%09%09%09x = y * 2;%0A%09%09%7D%0A%09%09// y = 100; // Error! y not known here%0A%09%09%0A%09%09// x is still known here.%0A%09%09System.out.println(%22x is %22 + x);%0A%09%7D%0A%7D%0A

Create ScopeDemo.java