inner class access to outer class method, same method names

You can do something like that :

public class A{
   void test(){
        System.out.println("Test from A");
    };
    public class B{
        void test(){
            System.out.println("Test from B");
            A.this.test();
        }
    }

    public static void main(String[] args) {
            A a = new A();
            B b = a.new B();
            b.test();
    }
}

You then have the following output :

Test from B
Test from A

01 public class A{
02   void test(){};
03   public class B{
04     void test(){
05       test();  // local B.test() method, so recursion, use A.this.test();
06     }
07   }
08 }

EDIT : As @Thilo mentioned : Avoid using same method names in outer class and inner class, this will avoid naming conflicts.