Polymorphism in Object-Oriented Programming Quiz

Polymorphism in Object-Oriented Programming Quiz

University

19 Qs

quiz-placeholder

Similar activities

Freight Rate

Freight Rate

University

16 Qs

Statistics Quiz

Statistics Quiz

University

20 Qs

Passive Voice(S. Present& S. Past)

Passive Voice(S. Present& S. Past)

University

16 Qs

Life of Jesus

Life of Jesus

KG - University

14 Qs

Chapter 4

Chapter 4

University

20 Qs

Rehab 105 Short Quiz 4 - Endterms

Rehab 105 Short Quiz 4 - Endterms

University

20 Qs

Psych drugs

Psych drugs

University

14 Qs

Polymorphism in Object-Oriented Programming Quiz

Polymorphism in Object-Oriented Programming Quiz

Assessment

Quiz

Other

University

Practice Problem

Medium

Created by

misbah daud

Used 6+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?