public class Scope { public void method1( ) { int x1 ; int x2 ; //Block scope { int x3 ; { int x4 ; //int x2 //Error Java does not allow hiding of variables } //x4 is out of scope } //x3 is out of scope. // x3 = 5 compiler error Scope scopeObject = new Scope() ; //x1 and x2 about to go out of scope //scopeObject about to go out of scope //However the obhect still exists in the heap } public static void main( String args[] ) { } }