Java protected Keyword

Java Keywords : The Student subclass accesses a Person class with protected attributes

Definition and Usage

The protected keyword is an access modifier used for attributes, methods and constructors, making them accessible in the same package and subclasses.

Related Pages

Read more about modifiers in our Java Modifiers Tutorial.