Saved Bookmarks
| 1. |
Observe the following C++ code and answer the questions (i) and (ii). Note: Assume all necessary files are included. class FIRST { int Num1; public: void Display () // Member Function1 { cout<< Num1<<end1;} };class SECOND : public FIRST { int Num2; public: void Display () //Member Function2{ cout<<Num2<<end1;} }; void main (){ SECOND S;............... //Statement 1 ............. //Statement 2 }(i) Which Object-Oriented Programming feature is illustrated by the definitions of classes FIRST and SECOND? (ii) Wife Statement 1 and Statement 2 to execute Member Function 1 and Member Function 2 respectively using the object S |
|
Answer» (i) Inheritance is an Object Oriented Programming feature which is illustrated by the definitions of classes FIRST and SECOND. (ii) Statement1 S.FIRST :: Display(); Statement 2 S.SECOND :: Display(); |
|