Which of the following modifier on members of a class that is not accessible to another class in different package but is accessible to any subclass in the same package?

protected : The protected access modifier is accessible within package and outside the package but through inheritance only. The protected access modifier can be applied on the data member, method and constructor. It can’t be applied on the class.

Sizin İçin Seçtik  Which of the following modifier is used to specify whether a member is a class member or an instance member Mcq?

Leave a Reply

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