The inner classes, and then not static, can access even if with some limitation to the variables of the outer class.
Continue reading “Getting the variables of the outer class from an 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:
where [OuterClassName] is the name of the outer class. Continue reading “How to access to the members of outer class from inner class”
In this article I explain how to set the visibility of methods and instance variables, ie those variables declared outside of any method (the variables declared within a method are called local variables and they are visible in the method only). Continue reading “The access modifiers of methods and variables of a java class”