public class test4 { public static void main(String[] args) { test4 a = new test4(); System.out.println(a.i); } public int i = 1; public test4 () { System.out.println(i); i=2; } }
输出结果为:
12
Process finished with exit code 0