Keyword for the outer class from an anonymous inner class [duplicate]

In general you use OuterClassName.this to refer to the enclosing instance of the outer class.

In your example that would be a.this.otherMethod()

Leave a Comment