Object-oriented programming in Java.
Private members are not inherited by the subclass, of the parent class. But in case a superclass has protected or public methods to access the private fields, subclass may use them.
Nested class holds access to enclosing class’s private members-both methods & fields. Hence protected or public nested class which has been inherited by subclass holds access of superclass’s private members indirectly.