Hi Sugantha,
Your understanding of order of execution is correct for static blocks, init blocks and constuctors.
Since the x in static block is belonging to that block only, i.e., local to that block. So no compilation error occurs with conflict to static int x.
Next you asked for the explanation for getting the output. Here it follows:
static variables x and y are initialized to 0 by default.
In the main method x-- makes it -1.
Then in myMethod x is post incremented so the equation for
y=x++ + ++x will be y=(-1)+(0+1) here x is -1, x++ will be 0 and then ++x will be 1, so y will be 0.
Thereafter in SOP the result printed will be 3.