1.

How can a protected modifier be accessed?(a) accessible only within the class(b) accessible only within package(c) accessible within package and outside the package but through inheritance only(d) accessible by all

Answer» The correct choice is (c) accessible within package and outside the package but through inheritance only

To explain I would say: 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 in the class.


Discussion

No Comment Found

Related InterviewSolutions