tags:

views:

77

answers:

2

how do we access outer class this instance: eg in

Class A {

   Class B {

      this.helloB();
      (A's this).hello()
   }
}

how do we access A's this instance in Java

+7  A: 

By prefixing this with the class: A.this.hello()

Similarly, when you want to create an instance of B outside of A, you can use a.new B() (where a instanceof A == true).

Aaron Digulla
+4  A: 

Just call

A.this.hello()
alasdairg