Problem Statement - Finding Type and Member Accessibility
Answer the questions (i) to (iv) based on the following:
class First { int X1; protected: float X2; public: First(); void Enter1(); void Display1(); }; class Second : private First { int Y1; protected: float Y2; public: Second(); void Enter2(); void Display(); }; class Third : public Second { int Z1; public: Third(); void Enter3(); void Display(); }; void main() { Third T; //Statement 1 __________________; //Statement 2 }
(i) Which type of Inheritance out of the following is illustrated in the above example? Single Level Inheritance, Multilevel Inheritance, Multiple Inheritance
(ii) Write the names of all the member functions, which are directly accessible by the object T of class Third as declared in main() function.
(iii) Write Statement 2 to call function Display() of class Second from the object T of class Third.
(iv) What will be the order of execution of the constructors, when the object T of class Third is declared inside main()?
Solution
CSKC| Created: 3-Jan-2019 | Updated: 13-Jan-2020|CBSE12A-2017