interface CallbackInterface {
  public void setX(int x);
}

class CallbackInterfaceOwner {
  private int x = 0;
  public int getX() {
    return x;
  }
  public CallbackInterfaceObject getCBIO() {
    return new CallbackInterfaceObject();
  }
  public class CallbackInterfaceObject
         implements CallbackInterface {
    public void setX(int x) {
      CallbackInterfaceOwner.this.x = x;
    }
  }
}

public class CallbackInterfaceTest {
  public static void main(String args[]) {
    CallbackInterfaceOwner c= new CallbackInterfaceOwner();
    CallbackInterface cbi = c.getCBIO();
    System.out.println("x is " + c.getX());
    cbi.setX(10);
    System.out.println("x is now " + c.getX());
  }
}