the output is
y is 6
a is 9
x is 6
is correct .
u got a method call before printing the value of x,so first it goes into the
method calla nd perform the necessary operation,in the method foo(int,int) u got
two println statements for y and a so first it prints them first and then it
prints the value of x,hope u got.