In Private inheritance a protected data member of the base class will be treated in derived class as
Answers
Answer:
Protected inheritance
Explanation:
protected inheritance makes the public and protected members of the base class protected in the derived class. private inheritance makes the public and protected members of the base class private in the derived class.
Concept:
One of the key notions of object-oriented programming (OOP) languages is inheritance. It's a way of deriving a class from another class in a hierarchy of classes with similar characteristics and functions.
Find:
In Private inheritance, a protected data member of the base class will be treated in the derived class as __________.
Solution:
In C++ inheritance, these 3 keywords: private, protected, and public are known as access specifiers.
Following are some features of private, protected, and public inheritance:
private inheritance
In the derived class, private inheritance makes the public and protected members of the base class private.
protected inheritance
The public and protected members of the base class are protected in the derived class protected inheritance.
public inheritance
The protected members of the base class stay protected in the derived class, whereas public inheritance makes public members of the base class public in the derived class.
∴ In private inheritance, a protected data member of the base class will be treated as private in the derived class.