class CallbackOwner {
  private int x = 0;
  public int getX() {
    return x;
  }
  public CallbackObject getCBO() {
    return new CallbackObject();
  }
  public class CallbackObject {
    public void setX(int x) {
      CallbackOwner.this.x = x;
    }
  }
}

public class CallbackTest {
  public static void main(String args[]) {
    CallbackOwner c= new CallbackOwner();
    CallbackOwner.CallbackObject cbo = c.getCBO();
    System.out.println("x is " + c.getX());
    cbo.setX(10);
    System.out.println("x is now " + c.getX());
  }
}