Categories
Java

How to access to the members of outer class from inner class

You can’t access to the members of an outer class from an inner class using the keyword “this”.
In fact, the keyword “this” in an inner class is a reference to the inner class itself.
To have a reference to the outer class, you must use the syntax:

[OuterClassName].this

where [OuterClassName] is the name of the outer class.