Discover answers to your questions with Westonci.ca, the leading Q&A platform that connects you with knowledgeable experts. Our Q&A platform provides quick and trustworthy answers to your questions from experienced professionals in different areas of expertise. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.
Sagot :
Declaring a member as protected in the base class provides access to that member in the derived classes but not to anyone else.
Base class and derived classes are concepts of inheritance in the paradigm of Object Oriented Programming. Inheritance is the process in which a new class (called derived class) is created from an existing class (called base class).
When a drive class is created from the base class, it has access to some members of the base class. There are three types of access specifiers to declare members in the base class in order to provide their access in the derived classes.
The first is declaring a member as private. Private members of the base class cannot be accessed by anyone, even not by the derived classes. The second is declaring the base class members as public. Public members can be accessed by anybody including derived classes. The third type is declaring members as protected. Protected members of the base class have accessibility only in derived classes.
Thus, when a member is declared as protected in the base class, it gives access to that member in the derived classes but not to anyone else.
You can learn more about access specifier at
https://brainly.com/question/28289695
#SPJ4
We hope you found what you were looking for. Feel free to revisit us for more answers and updated information. Thank you for your visit. We're committed to providing you with the best information available. Return anytime for more. Thank you for visiting Westonci.ca. Stay informed by coming back for more detailed answers.