以下代码是合法前向引用的情况吗?如果是,为什么?
public class MyClass
{
private static int x = getValue();
private static int y = 5;
private static int getValue()
{
return y;
}
public static void main(String[] args)
{
System.out.println(x);
}
}
Run Code Online (Sandbox Code Playgroud)