public class P implements I {
  static int sv = 9;
  int v = 8;
  // static final int ANSWER = 54; // Try removing the comment.

  public static void sm() {
    System.out.println(
      "P: sm(): sv = " + sv);
  }

  public P m() {
    System.out.println("P: "
      + sv + " X " + v + " = "
      + ANSWER);
    return this;
  }

  // Here is a new method to exercise super.mem and this.mem
  public void newMethod() {
    int v=66;

    // To locate the target of a bare reference, like v, check for
    // local variables and method parameters first...
    System.out.println("P: newMethod: local v = "+v);

    // You can skip the local variables and method parameters by using this...
    System.out.println("P: newMethod: this.v = "+this.v);

    /* No member v in parent class:
    System.out.println("P: newMethod: super.v = "+super.v);
    */

    System.out.println("P: newMethod: calling this.m()");
    this.m();  // Just use m(), for Pete's (your TA's) sake....
    // But the point of this example is to illustrate that 
    // 'this' does not change the way methods are looked up, it
    // works like a standard reference of type P to the current object.
    // That is, WE STILL GET THE BOTTOM-MOST m() in this object. 
    // For example: If the current object is of class B, for example,
    // the reference this.m() refers to the method m() defined in class B,
    // not the overridden method m() in the current class P.
    // This is quite different from super...which changes the start
    // class for the lookup.  (See classes A and B.)

    /* No method super.m()
    System.out.println("P: newMethod: calling super.m()");
    super.m();
    */
    
    System.out.println("P: newMethod is done.\n");
  }

}
