Advertisements
Advertisements
Question
The access specifier that is applicable in case of inheritance is:
Options
default
private
public
protected
MCQ
Advertisements
Solution
protected
Explanation:
The protected modifier allows class variables and methods to be hidden from the general public while remaining fully visible and accessible to any subclass (child class) that inherits from it, even if that subclass resides in a completely different package.
shaalaa.com
Is there an error in this question or solution?
