Question:
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 Function 1
{
cout<<Num1<<endl;
}
};
class SECOND: public FIRST
{
int Num2;
public:
void Display() //Member Function 2
{
cout<<Num2<<endl;
}
};
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)Β Write Statement 1 and Statement 2 to execute Member Function 1 and Member
Function 2 respectively using the object S.
C. Sir| Created: 3-Dec-2018 | Updated: 22-Mar-2026|CBSE12A-2018
