【发布时间】:2012-04-05 20:55:55
【问题描述】:
以下代码是合法前向引用的情况吗?如果是,为什么?
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);
}
}
【问题讨论】:
标签: java reference forward static-initialization