class TestThisAndSuper {

    public static void main(String[] args) {
    
        Super sup = new Super(10,15);
        System.out.println("Super x: " + sup.x + " y: " + sup.y);
        
        Subclass sub = new Subclass(20,25,30);
        System.out.println("Sub x: " + sub.x + " y: " + sub.y + " w: " + sub.w);
    }

}

class Super {

    int x;
    int y;

    Super(){
        System.out.println("Super object being created.");
    }

    Super( int x, int y ) {
        this();             // call no-arg constructor
        this.x = x;
        this.y = y;    
    }
}

class Subclass extends Super {

    int w;

    Subclass(){
        this(0,0,0);        // call 3-param constructor
    }
    
    Subclass( int x, int y ) {
        this(x,y,0);        // call 3-param constructor
    }
    
    Subclass( int x, int y, int w ) {    
        super(x,y);         // call superclass constructor
        this.w = w;
    }
}
