when i compile and run this code it first prints x is 0 then it prints x is 1000; I dont understand how it says x is 0? once the v() method is invoked, directly it goes to that method and i think during this the compiler doesnt have any idea about x.Then how it assumes x to be an integer and gives its default value? But if i change the line 2 as int a=x; it says illegal forward reference. could anyone explain me why? Thanx.