Inner class is regarded as an attribute of the Outer class. Therefore, no matter the Inner class instance variable is private or not, Outer class can access without any problem just like accessing its other private attributes(variables) .
Read moreCan inner classes access outer class members C++?
An inner class is a friend of the class it is defined within. So, yes; an object of type Outer::Inner can access the member variable var of an object of type Outer .8 Kas 2011
Read moreCan Java inner class be static?
Non-static nested classes are called inner classes. Nested classes that are declared static are called static nested classes. A nested class is a member of its enclosing class. Non-static nested classes (inner classes) have access to other members of the enclosing class, even if they are declared private.
Read moreCan inner class extend any class?
It can extend exactly one class or implement exactly one interface . It can implement multiple interfaces regardless of whether it also extends a class.
Read more