class B : public A { ... // public members of A are public members of 3 // prote
ID: 3770753 • Letter: C
Question
class B : public A { ... // public members of A are public members of 3 // protected members of A are protected members of 3 class C : protected A { ... // public and protected members cf A are protected members of C class D : private A { ... // public and protected members cf A are private members of D In all cases, private members of A are private member of D. Under what circumstances can an object of class B, C or D be used as an object of class A? In other words, under what circumstances is type B, C or D a subtype of A?Explanation / Answer
When all the subclass inherites class A as public then object of class B,C and D can be used as object of A
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.