Polymorphism

Polymorphism

University

6 Qs

quiz-placeholder

Similar activities

Pemrograman Berorientasi Objek

Pemrograman Berorientasi Objek

10th Grade - University

10 Qs

QUIZ PBO R5I

QUIZ PBO R5I

University

10 Qs

QUIZ PBO R5L

QUIZ PBO R5L

University

10 Qs

AP CSA Inheritance Polymorphism

AP CSA Inheritance Polymorphism

University

10 Qs

Object Oriented Programming

Object Oriented Programming

University

9 Qs

Topik 2: Ciri-ciri Object Oriented Programming (OOP)

Topik 2: Ciri-ciri Object Oriented Programming (OOP)

University

10 Qs

DesignPatterns

DesignPatterns

University

9 Qs

Object Oriented Programming Quizizz

Object Oriented Programming Quizizz

10th Grade - University

11 Qs

Polymorphism

Polymorphism

Assessment

Quiz

Computers

University

Medium

Created by

JHAN MAR MERGAL

Used 15+ times

FREE Resource

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement about method overriding is correct?

Subclasses can override private methods from their superclass.

Method overriding is determined at compile-time.

Overridden methods in subclasses must have the same method signature (name, return type, and parameters) as in the superclass.

Overriding methods in subclasses cannot have a different access modifier than the superclass method.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements regarding polymorphism and method overloading is correct?

Polymorphism is achieved through method overloading.

Method overloading is achieved through polymorphism.

Polymorphism and method overloading are unrelated concepts.

Method overloading can only be done in abstract classes.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement about interfaces and polymorphism is true?

Interface or abstract class, and various classes can implement or extend it, providing their own implementations of the methods.

Interface methods can have implementation (code) in the interface itself.

Polymorphism can only be achieved through class inheritance, not interface implementation.

An interface can extend multiple other interfaces, but a class can only implement one interface.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Assuming that Circle, Rectangle, and Triangle are subclasses of Shape with appropriate draw() methods, what happens when you call shapes[1].draw();?

It will result in a compilation error.

It will call the draw() method of Shape.

It will call the draw() method of Rectangle.

It will call the draw() method of Circle.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the code?

Drawing a shape

Drawing a square

Drawing a triangle

Drawing a circle

6.

OPEN ENDED QUESTION

3 mins • 5 pts

In your own words, Explain Polymorphism.

Evaluate responses using AI:

OFF