
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
Choose the level of Bloom’s Taxonomy
Quiz
•
University
15 questions
After Effect Intoduction
Quiz
•
10th Grade - University
14 questions
Linux: Users and Groups
Quiz
•
9th Grade - University
10 questions
Serie A 2023
Quiz
•
University
10 questions
Herencia y Paquetes
Quiz
•
University
12 questions
Spreadsheet Starter
Quiz
•
7th Grade - University
15 questions
Brewing JavaFX Quiz
Quiz
•
University
10 questions
Adobe Photoshop
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
29 questions
Alg. 1 Section 5.1 Coordinate Plane
Quiz
•
9th Grade
22 questions
fractions
Quiz
•
3rd Grade
11 questions
FOREST Effective communication
Lesson
•
KG
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
12 questions
IREAD Week 4 - Review
Quiz
•
3rd Grade - University
7 questions
Fragments, Run-ons, and Complete Sentences
Interactive video
•
4th Grade - University
7 questions
Renewable and Nonrenewable Resources
Interactive video
•
4th Grade - University
10 questions
DNA Structure and Replication: Crash Course Biology
Interactive video
•
11th Grade - University
5 questions
Inherited and Acquired Traits of Animals
Interactive video
•
4th Grade - University
5 questions
Examining Theme
Interactive video
•
4th Grade - University
20 questions
Implicit vs. Explicit
Quiz
•
6th Grade - University
7 questions
Comparing Fractions
Interactive video
•
1st Grade - University