Advertisements
Advertisements
Question
State True or False.
Member data and methods declared under protected access specifier are availlable to members of its own class and to its subclasses and not to any other class.
True or False
Advertisements
Solution
This statement is true.
Explanation:
Members declared with the protected access specifier are accessible within their own class and by subclasses (child classes). They are not accessible by unrelated classes outside the inheritance relationship.
shaalaa.com
Is there an error in this question or solution?
Chapter 6: Encapsulation - Exercises [Page 148]
