Polymorphism and Abstract Classes - C++ (MCQ) questions and answers

Here, you can read Polymorphism and Abstract Classes multiple choice questions and answers with explanation.

1)   A virtual function that has no definition within the base class is called____________.
- Published on 19 Oct 15

a. Pure virtual function
b. Pure static function
c. Pure Const function
d. Friend function
Answer  Explanation 

ANSWER: Pure virtual function

Explanation:
No explanation is available for this question!


2)   If abstract class is inherited by derived class, then_______________ .
- Published on 19 Oct 15

a. Derived class should provide definition for all the pure virtual functions
b. Derived class also become abstract if fails to implement pure virtual functions
c. Objects of derived class can’t be created if it fails to implement pure virtual functions
d. All of these
Answer  Explanation 

ANSWER: All of these

Explanation:
No explanation is available for this question!


3)    If a class contains pure virtual function, then it is termed as____________________ .
- Published on 19 Oct 15

a. Virtual class
b. Sealed class
c. Pure Local class
d. Abstract Class
Answer  Explanation 

ANSWER: Abstract Class

Explanation:
No explanation is available for this question!


4)   When a virtual function is redefined by the derived class, it is called___________.
- Published on 19 Jul 15

a. Overloading
b. Overriding
c. Rewriting
d. All of these
Answer  Explanation 

ANSWER: Overriding

Explanation:
No explanation is available for this question!


5)   Which of the followings are true about Virtual functions?
- Published on 17 Jul 15

a. They must be non-static member function of the class
b. They cannot be friends
c. Constructor Functions cannot be virtual
d. All of these
Answer  Explanation 

ANSWER: All of these

Explanation:
No explanation is available for this question!


6)   We can create objects of the abstract class.
- Published on 17 Jul 15

a. True
b. False
Answer  Explanation 

ANSWER: False

Explanation:
No explanation is available for this question!


7)   Find the wrong statement/s about Abstract Class.
- Published on 17 Jul 15

a. We can’t create its objects.
b. We can’t create pointers to an abstract class.
c. It contains at least one pure virtual function.
d. We can create references to an abstract class.
Answer  Explanation 

ANSWER: We can’t create pointers to an abstract class.

Explanation:
No explanation is available for this question!


8)   Runtime polymorphism is achieved only when a virtual function is accessed through a pointer to the base class.
- Published on 17 Jul 15

a. True
b. False
Answer  Explanation 

ANSWER: True

Explanation:
No explanation is available for this question!


9)   Syntax for Pure Virtual Function is ______________ .
- Published on 17 Jul 15

a. virtual void show()==0
b. void virtual show()==0
c. virtual void show()=0
d. void virtual show()=0
Answer  Explanation 

ANSWER: virtual void show()=0

Explanation:
No explanation is available for this question!


10)    _______________ is a member function that is declared within a base class and redefined by derived class.
- Published on 17 Jul 15

a. virtual function
b. static function
c. friend function
d. const member function
Answer  Explanation 

ANSWER: virtual function

Explanation:
No explanation is available for this question!


1 2