MCQs – C++ Polymorphism

(Last Updated On: September 1, 2018)
Q) Compile time polymorphism in C++ language are
  1. Operator overloading
  2. Function overloading
  3. Function overriding
  4. B Only
  5. A & B
View Answer
Answer: E

 

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
View Answer
Answer: D

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
View Answer
Answer: C

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
View Answer
Answer: B

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

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 post. Also, the program example of new and delete operator overloading