‹ Back to the paper
Question 27
1 mark
Computer ScienceISC Computer Science - Competency Focused Practice Questions (CISCE, August 2024)Short answerInheritance, Interfaces and Polymorphism
Answer the following question.
What will happen if data members of super class are made private instead of protected?
Answer
Answer
If 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.