The following code snippets show how to access the enclosing class from an inner class.

 public class TestIt {
  public static void main(String a[]){
     new TestIt().doit();
  }
  public void doit() {
      new InnerClass().sayHello();
  }
  public void enclosingClassMethod(){
      System.out.println("Hello world!");
      }
   class InnerClass {
      public void sayHello() {
         TestIt.this.enclosingClassMethod();
         }
    }
}

or

public class TestIt {
  TestIt testItClass = this;
  public static void main(String a[]){
     new TestIt().doit();
  }
  public void doit() {
      new InnerClass().sayHello();
  }
  public void enclosingClassMethod(){
      System.out.println("Hello world!");
      }
   class InnerClass {
      public void sayHello() {
         testItClass.enclosingClassMethod();
         }
    }
}