Advertisements
Advertisements
Question
The most restrictive access specifier is ______.
Options
private
public
protected
default
MCQ
Fill in the Blanks
Advertisements
Solution
The most restrictive access specifier is private.
Explanation:
This is the most restrictive access modifier in Java. Any member (variable or method) marked as private can only be accessed within the exact same class in which it is declared. It is completely hidden from subclasses, other classes in the same package, and external packages.
shaalaa.com
Is there an error in this question or solution?
Chapter 3: User-Defined Methods - Exercises [Page 90]
