Cpp Inheritance MCQs 2

6.
Can we pass parameters to base class constructor though derived class or derived class constructor?

A. Yes
B. No
C. May Be
D. Can’t Say

7.
What are the things are inherited from the base class?

A. Constructor and its destructor
B. Operator=() members
C. Friends
D. All of the above


8.
Types of inheritance in C++ are

A. Multilevel
B. Multiple
C. Hierarchical
D. All the above

9.
What will be the output of the following program?

#include<iostream>
using namespace std;
class find {
public:
   void print()  { cout <<" In find"; }
};
  
class course : public find {
public:
   void print() { cout <<" In course"; }
};

class tech: public course { };
  
int main()
{
  tech t; 
  t.print();
  return 0;
}

A. In find
B. In course
C. Compiler Error: Ambiguous call to print()
D. None of the above

10.
Which symbol is used to create multiple inheritance?

A. Dot
B. Comma
C. Dollar
D. None of the above