Can protected access modifier be accessed within a class?

Protected Access Modifier – Protected Variables, methods, and constructors, which are declared protected in a superclass can be accessed only by the subclasses in other package or any class within the package of the protected members’ class. The protected access modifier cannot be applied to class and interfaces.

Sizin İçin Seçtik  Is subclass a class in Java?

Leave a Reply

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