We can declare the inner classes as private or protected , but it is not allowed in outer classes.
Read moreCan inner class be protected in Java?
Java inner class is defined inside the body of another class. Java inner class can be declared private, public, protected, or with default access whereas an outer class can have only public or default access.
Read moreWhat is protected class Java?
The protected keyword is an access modifier used for attributes, methods and constructors , making them accessible in the same package and subclasses.
Read moreCan nested class be protected?
Nested classes that are declared static are called static nested classes. A nested class is a member of its enclosing class. … Static nested classes do not have access to other members of the enclosing class. As a member of the OuterClass , a nested class can be declared private , public , protected , or package private .
Read more