In several object-oriented languages, including C++ and Eiffel, a derived class can hide members of the base

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 a base class to be public, protected, or private:

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

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*?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: