Any variable, method, or class declared to use the default access modifier cannot be accessed by any other class outside of the package from which it was declared.
Read moreWhich of the following modifiers are used to control access to a class member?
The private modifier specifies that the member can only be accessed in its own class. The protected modifier specifies that the member can only be accessed within its own package (as with package-private) and, in addition, by a subclass of its class in another package.
Read moreWhich 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.
Read moreWhich of the following modifier is used to specify whether a member is a class member or an instance member Mcq?
a) Static : This modifier is used to check that a member is a class member or instance member.
Read more