-
How can a protected modifier be accessed?
-
- accessible by all
- accessible only within package
- accessible only within the class
- accessible within package and outside the package but through inheritance only
- None of these
Correct Option: D
The protected access modifier is accessible within package and outside the package but only through inheritance. The protected access modifier can be used with data member, method and constructor. It cannot be applied on the class.