/*****************************************************/ // INHERIT10 // cannot access $private$ member with // $super$.member class A { private int x; public A(int x) { this.x = x; } public void print() { System.out.println(x); } } class B extends A { public B(int x) { super(x); } public void print() { // cannot "see" the "uninherited" $x$ // System.out.println(super.x); // but, can see an inherited method! super.print(); } } public class inherit10 { public static void main(String[] args) { new B(1).print(); } } /* output: 1 */