Considering you will manage to compile this code somehow eg. removing or declaring variable i , when we run this program we get the following output
test 1Code Ranch
test 2null
Test:Code Ranch
What does it mean...Simply that method
test is run before the main method. See whenever you have static method or block in your class it is loaded first whenever the class is loaded by jvm. So In this case static method test is run before the main method.
I hope it will clear your doubt.
Thanks,
Patricia