
C++ Polymorphism Quiz

Quiz
•
Other
•
University
•
Hard
Justine Nichol Pasamonte
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following best illustrates runtime polymorphism in C++?
Two functions named print() with different parameter types
A virtual method overridden in a derived class and called through a base class pointer
Overloading the + operator to add matrices
Defining multiple constructors in a class
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which condition must be met for function overriding to achieve runtime polymorphism in C++?
The derived function must have default parameters
The base class function must be declared with the virtual keyword
Both base and derived class functions must be private
Function names must differ across classes
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What distinguishes operator overloading from function overriding in C++?
Operator overloading changes behavior based on operand types at compile time, while function overriding changes behavior at runtime
Operator overloading is only applicable to arithmetic operators
Function overriding does not support inheritance
Operator overloading uses the virtual keyword
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following correctly explains why compile-time polymorphism executes faster than runtime polymorphism?
It uses inline assembly optimization
The compiler completely eliminates function calls
The function binding is resolved during compilation
It avoids object-oriented features
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What enables polymorphic behavior when calling a function through a base class reference?
The function must be overloaded
The base class must be abstract
The base class function must be declared virtual
The function must return void
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is a limitation of compile-time polymorphism in C++?
It doesn't allow operator overloading
It cannot resolve behavior based on actual object type at runtime
It cannot use static binding
It depends on the use of pointers
7.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which of the following pairs represent only runtime polymorphism techniques?
Function overloading and inheritance
Function overriding and operator overloading
Templates and overloaded constructors
Virtual functions and overridden methods
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
CL.5 BK.2-3-Closed Circuits

Quiz
•
5th Grade - University
20 questions
Informatika

Quiz
•
9th Grade - University
10 questions
Java set 1

Quiz
•
University
10 questions
PTW

Quiz
•
12th Grade - University
10 questions
Latihan Diagram

Quiz
•
University
10 questions
Quis PBO

Quiz
•
University
20 questions
Quanta

Quiz
•
University
10 questions
CHAPTER 3

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Other
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University