This question already has an answer here:
- Getting hold of the outer class object from the inner class object 9 answers
In the following snippet:
public class a {
public void otherMethod(){}
public void doStuff(String str, InnerClass b){}
public void method(a){
doStuff(\"asd\",
new InnerClass(){
public void innerMethod(){
otherMethod();
}
}
);
}
}
Is there a keyword to refer to the outer class from the inner class? Basically what I want to do is outer.otherMethod()
, or something of the like, but can\'t seem to find anything.