It would likely be easier to see if the code were properly indented, but there are two variables named x in the class. To which does the line in question refer?
Bear sir,
i think think that the initialised int x = 24; is an instance variable and cannot be called by the static method void go(). i thought it would not compile
toshit kolhe wrote:i think think that the initialised int x = 24; is an instance variable and cannot be called by the static method void go().
That's correct, but as Bear says, you have two variables called x, so have you considered it might be the other x that is being referenced in the go method.