Каким будет результат компиляции и выполнения данного кода:

public class Test {
    static int b = Test.a;
    static int a = 3;
    static {
       System.out.println("a=" + a + ", b=" + b);
    }
}
Укажите все подходящие варианты.
Explanation
The static initializers and class variable initializers are executed in textual order, and may not refer to class variables declared in the class whose declarations appear textually after the use, even though these class variables are in scope (§8.3.2.3). This restriction is designed to detect, at compile time, most circular or otherwise malformed initializations.

( JLS 12.4.1)

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з Java
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести