How to get the parent of this object from a method in an inner class?
class OuterClass {
public outerMethod() {
}
class InnerClass {
public innerMethod() {
}
}
}
One way is to add a method, for example
public OuterClass getthis() {
return this;
}
Any other suggestions? Is there a way from Java itself?
source
share