// INHERIT6
class A {
    protected int x;
    A(int x) { this.x = x; }
    public void get_x() { System.out.println("A: "+x); }
}

class B extends A {
    B(int x) { super(x); }
    public void stuff() { 

	// $super$ treats the current object as an instance of $A$

	get_x();        // current object: use class $B$
	super.get_x();  // current object: use class $A$

	super.x = 2;    // current object: use class $A$

	get_x();        // current object: use class $B$
	super.get_x();  // current object: use class $A$
    }

    public void get_x() { System.out.println("B: "+x); }
}

public class inherit6 {
    public static void main(String[] args) {
	new B(1).stuff();
    }
}

/*
B: 1
A: 1
B: 2
A: 2
*/
