Polymorphism in Object-Oriented Programming Quiz

Polymorphism in Object-Oriented Programming Quiz

University

19 Qs

quiz-placeholder

Similar activities

2 Python 1

2 Python 1

University

20 Qs

Computer Science Quiz

Computer Science Quiz

University

17 Qs

Quiz on Kindness to Animals

Quiz on Kindness to Animals

6th Grade - University

14 Qs

Vibr Labs Tech Quiz - 2

Vibr Labs Tech Quiz - 2

University

20 Qs

kuis pasca uts 1

kuis pasca uts 1

University

15 Qs

QUIZ 3 AG-MCAS4112 BSA 4A&4B

QUIZ 3 AG-MCAS4112 BSA 4A&4B

University

14 Qs

Spring Semester QUIZ 5

Spring Semester QUIZ 5

University

15 Qs

Python

Python

University

15 Qs

Polymorphism in Object-Oriented Programming Quiz

Polymorphism in Object-Oriented Programming Quiz

Assessment

Quiz

Other

University

Medium

Created by

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

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?