Refer to member variables that enclose larger scopes by the class name to which they belong. For example, the following statement accesses the member variable of the class
ShadowTest
from the methodmethodInFirstLevel
:
System.out.println("ShadowTest.this.x = " + ShadowTest.this.x);
Just learned about this. I guess it doesn’t come up often.