‹ Back to the paper
What will happen if data members of super class are made private instead of protected?
Answer
Answer
AIIf the data members of the super class are made private, they become inaccessible directly in the subclass. The subclass would no longer be able to refer to colour and registration by name in its own methods; it would have to use public getter/setter (accessor/mutator) methods of the super class to access or change them.
From ISC Computer Science - Competency Focused Practice Questions (CISCE, August 2024), question 27.