First, the code will not compile, as you are referencing instance variables i and j from a static method.
The code does compile and run as posted. The reason i is printing 0 is as follows (in my mind):
1. In first pass (when Object is being create), compiler is will define and assign default values to all member variables. So i and j both get zeros.
2 In second pass, compiler will actually evaluate the programmer's assigned value for each member, in the textual order. While doing so for i, it needs the value of j. At that time j is zero, so i gets 0. Next, j is assined 10. If you put a print statement after it, you see j is 10.
Hope this helps
Barkat