MCQs – C++ Polymorphism


Q) Interface class in C++ is created by
  1. Using interface keyword before class
  2. Using pure virtual function
  3. Using pure virtual function and virtual function both
  4. Using class keyword

Answer: 2

C++ does not have keyword interface like C# or java. Pure virtual function is used to create an interface in C++ programs.


Q) Which statements are true about an abstract class
  1. Abstract class has at least one pure virtual function.
  2. Pointer for an abstract class can be created
  3. Object of an abstract class cannot be created.
  4. All are correct.

Answer: 4


Q) Run time polymorphism in C++ Program is
  1. New and delete operator overloading
  2. ++ and – – operator overloading
  3. :: operator overloading
  4. None

Answer: 4


Q) Run time binding is related to
  1. Function overriding
  2. Operator overloading
  3. A & B
  4. None

Answer: 1


Q) Which function cannot be overloaded in C++
  1. Constructor
  2. Class destructor
  3. Both a & b
  4. None

Answer: 2

Destructor of a class cannot be overloaded. Read in detail in the interview question can we overload destructor in C++ program?


Q) Operators can be overloaded in C++ is/are
  1. New
  2. Delete
  3. ++
  4. All can be overloaded

Answer: 4


Related Posts