In the first case variable j is initiated at class load time, so it is already initiated when an object of class TestStaticOrder is created (and variable i initiated). So it compiles fine.
In the second case there is a forward reference to uninitiated varaible j, with is forbidden. So it doesn't compile.