MCQs – C++ Polymorphism


Q) Compile time polymorphism in C++ language are
  1. Operator overloading
  2. Function overloading
  3. Function overriding
  4. B Only
  5. A & B

Answer: 5


Q) C++ abstract class can contain
  1. Pure virtual function
  2. Non-virtual function
  3. Only pure virtual function
  4. Both pure virtual and non-virtual function

Answer: 4


Q) False statements about function overloading is
  1. Defining multiple functions with same name in a class is called function overloading
  2. Overloaded function must differ in their order and types of arguments.
  3. Overloaded functions should be preceded with virtual keyword
  4. No statement is false

Answer: 3


Q) Following keyword is used before a function in a base class to be overridden in derived class in C++
  1. override
  2. virtual
  3. void
  4. none

Answer: 2


Q) Which of the following cannot be overloaded in C++?
  1. Increment operator
  2. Constructor
  3. Destructor
  4. New and delete operator

Answer: 3

Destructor of a class cannot be overloaded in C++ programming. Increment operator, constructor and new and delete can be overloaded.

You can read here in C++ constructor overloading example and benefits of constructor overloading in C++ programs. Also the program example of new and delete operator overloading.


Related Posts