
Exploring OOP: Polymorphism and Abstraction
Authored by mario santos
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
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the primary purpose of method overriding in C++?
To allow a class to have multiple methods with the same name but different parameters.
To provide a specific implementation of a method that is already defined in its base class.
To hide the implementation details of a method.
To create a new class from an existing class.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is true about abstract classes in C++?
An abstract class cannot have any member variables.
An abstract class can be instantiated directly.
An abstract class must have at least one pure virtual function.
An abstract class cannot have any constructors.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is a virtual function in C++?
A function that is defined in a derived class but not in the base class.
A function that is declared within a base class and is meant to be overridden in derived classes.
A function that cannot be overridden in derived classes.
A function that is only used for input/output operations.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you declare a pure virtual function in C++?
By using the keyword `virtual` followed by `= 0`.
By using the keyword `abstract` before the function name.
By using the keyword `override` after the function name.
By using the keyword `final` after the function name.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is true about polymorphism in C++?
Polymorphism allows objects to be treated as instances of their own class only.
Polymorphism is achieved through method overloading only.
Polymorphism allows objects to be treated as instances of their base class.
Polymorphism is not supported in C++.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
Base
Derived
Compilation error
Runtime error
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a characteristic of an abstract class in C++?
It can have non-virtual functions.
It can have member variables.
It can be instantiated.
It can have constructors.
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
12 questions
Tecnología - Almacenamientonube_10
Quiz
•
University
10 questions
Python with DataScience
Quiz
•
7th Grade - University
16 questions
Pengantar Teknologi Informasi 7
Quiz
•
University
10 questions
UTILITY PROGRAM
Quiz
•
University
13 questions
Digital Technology Office 365 - 29May2020
Quiz
•
University - Professi...
20 questions
DBMS Quiz
Quiz
•
University
10 questions
Tes Awal Modul 6 CC
Quiz
•
University
15 questions
Computer and Other Human Inventions
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
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade