Can inner class access outer class private variable?

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) .

Sizin İçin Seçtik  Can inner classes access outer class members C++?

Leave a Reply

Your email address will not be published. Required fields are marked *