public class Main {
static int x = Main.y;
// static int x = y; //Not allowed; y is not defined
static int y = x;
public static void main(String[] args) {
System.out.println(x);//prints 0
}
}
Run Code Online (Sandbox Code Playgroud)
为什么我被允许在课堂上使用,但不能直接使用?
什么时候定义?