
MCQs on Polymorphism in C++
Authored by stuti Ahuja
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an example of compile-time polymorphism?
Function Overloading
Operator Overloading
Both A and B
None of the above
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? class Base { public: virtual void display() { cout << "Base Display"; } }; class Derived : public Base { public: void display() { cout << "Derived Display"; } }; Base* b = new Derived(); b->display();
Base Display
Derived Display
Compilation Error
Runtime Error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements about virtual functions is true?
They can be static.
They cannot be overridden.
They must be defined in the base class.
They are always inlined.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens if a derived class does not override a virtual function?
The derived class will have a compilation error.
The base class function will be called.
The derived class will call its own function.
None of the above.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a pure virtual function in C++?
virtual void func() = 0;
void func() = 0;
void func();
virtual void func();
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to implement polymorphism?
Using function overloading.
Using operator overloading.
Using virtual functions.
All of the above.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following best describes dynamic polymorphism?
It occurs at compile-time.
It is achieved through virtual functions and inheritance.
It is the same as function overloading.
None of the above.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Let's Play Together
Quiz
•
University - Professi...
10 questions
Chapter 11 Quizz
Quiz
•
University
10 questions
HVBS - Day 2 Assessment
Quiz
•
University
10 questions
Machine Learning (Introduction)
Quiz
•
University
11 questions
Determining System Requirements
Quiz
•
University
15 questions
1.1.1 The structure and function of the processor
Quiz
•
11th Grade - University
10 questions
Planning and Implementation of Information Security
Quiz
•
University
10 questions
INTO Artificial Intelligence
Quiz
•
University - Professi...
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
10 questions
Probability Practice
Quiz
•
4th Grade
15 questions
Probability on Number LIne
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
6 questions
Appropriate Chromebook Usage
Lesson
•
7th Grade
10 questions
Greek Bases tele and phon
Quiz
•
6th - 8th Grade
Discover more resources for Computers
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
20 questions
Endocrine System
Quiz
•
University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
30 questions
W25: PSYCH 250 - Exam 2 Practice
Quiz
•
University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University
38 questions
Unit 8 Review - Absolutism & Revolution
Quiz
•
10th Grade - University