public class Main {
public static void main(String[] args){
System.out.println(X.Y.Z);
}
}
class X {
static class Y {
static String Z = "Result 1";
}
static C Y = new C();
}
class C {
String Z = "Result 2";
}
The output is time "Result 1", and sometimes "Result 2". Can you explain why?
I use JDK 1.6_33.
source
share