Page 277 - C++
P. 277

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() ?
      91                                             7                                        P.T.O.
   272   273   274   275   276   277   278   279   280   281   282