C++ Polymorphism Quiz

C++ Polymorphism Quiz

University

15 Qs

quiz-placeholder

Similar activities

Round 2

Round 2

University

20 Qs

Day1

Day1

University

15 Qs

Java OOP Concepts Quiz

Java OOP Concepts Quiz

University

19 Qs

Round 3

Round 3

University

20 Qs

EME316 QUIZ 01

EME316 QUIZ 01

University

20 Qs

Polymorphism in Object-Oriented Programming Quiz

Polymorphism in Object-Oriented Programming Quiz

University

19 Qs

Java Simple - 1

Java Simple - 1

University

20 Qs

IMPERATIVE VS OOP

IMPERATIVE VS OOP

University

15 Qs

C++ Polymorphism Quiz

C++ Polymorphism Quiz

Assessment

Quiz

Other

University

Hard

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?