Access to private field of a super class
问题 As everyone knows, private fields are not inherited between classes. What intrigues me, is how it works for inner static classes. Consider the following code: public class Main { public static void main(String[] args) { new B(); } private static class A { private int a = 10; private void foo() { System.out.println("A.foo"); } } private static class B extends A { { // foo(); // compile-time error super.foo(); // ok // System.out.println(a); // compile-time error System.out.println(super.a); //