
Polymorphism in Object-Oriented Programming Quiz

Quiz
•
Other
•
University
•
Medium
misbah daud
Used 6+ times
FREE Resource
19 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is polymorphism in Object-Oriented Programming?
The ability to overload operators
The ability to create templates
The ability to create multiple classes
The ability to treat objects of different classes as objects of a common base class
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is an example of run-time polymorphism?
Operator overloading
Function overloading
Using a base class pointer to call a derived class method
Using templates
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What keyword is used to declare a virtual function in C++?
dynamic
function
virtual
override
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the 'override' keyword indicate in a derived class?
It prevents the function from being overridden
It specifies that the function is overriding a base class function
It indicates that the function is virtual
It creates a new function
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of function templates?
To create multiple functions with the same name
To allow functions to operate with generic types
To overload operators
To define virtual functions
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In the context of polymorphism, what is function overloading?
Overriding a base class function in a derived class
Creating a function that can take any type of argument
Using different function names for the same operation
Using the same function name with different parameters
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code: 'Animal* a; Dog d; a = &d; a->sound();' if sound() is not virtual?
No output
Dog barks
Animal makes a sound
Compilation error
Create a free account and access millions of resources
Similar Resources on Wayground
14 questions
Management Quiz

Quiz
•
University
16 questions
Microsoft excel quizes

Quiz
•
10th Grade - University
15 questions
C++ Polymorphism Quiz

Quiz
•
University
15 questions
Inheritance in Object-Oriented Programming

Quiz
•
University
15 questions
Are you smarter than a 12th grader?

Quiz
•
11th Grade - University
15 questions
B1A Electro 2 Semi-Final Quiz No. 1

Quiz
•
University
21 questions
Power BI Relationships and DAX Quiz

Quiz
•
12th Grade - University
15 questions
Microeconomics

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University