Question: In several object-oriented languages, including C++ and Eiffel, a derived class can hide members of the base class. In C++, for example, we can declare
In several object-oriented languages, including C++ and Eiffel, a derived class can hide members of the base class. In C++, for example, we can declare a base class to be public, protected, or private:

In all cases, private members of A are inaccessible to methods of B, C, or D. Consider the impact of protected and private base classes on dynamic method binding. Under what circumstances can a reference to an object of class B, C, or D be assigned into a variable of type A*?
class B : public A {... // public members of A are public members of B // protected members of A are protected members of B ... class C : protected A {... // public and protected members of A are protected members of C ... class D : private A { ... // public and protected members of A are private members of D
Step by Step Solution
3.35 Rating (167 Votes )
There are 3 Steps involved in it
class B public A anybody can convert assign a B into ... View full answer
Get step-by-step solutions from verified subject matter experts
