Polymorphism

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What is polymorphism?

Ability of an object to take on many forms.

What is polymorphism?

Ability to perform a single action in different ways.

What is polymorphism?

Ability to take on many forms.

What types can a reference variable be declared as?

Class or interface type.

What is the benefit of polymorphism?

Consistent code writing.

What does the term 'morphs' mean in polymorphism?

Forms

What makes an object polymorphic in Java?

If it can pass more than one IS-A test.

What does polymorphism allow in terms of member or method names?

It allows the same name for a member or method in a class with different types.

What does the term 'poly' mean in polymorphism?

Many

Can the type of a reference variable be changed?

No, once declared, the type of a reference variable cannot be changed.

What does polymorphism allow you to define?

One interface with multiple implementations

How can an object be accessed in Java?

Only through a reference variable.

What does polymorphism support in terms of type conversion?

Polymorphism supports implicit type conversion.

What is polymorphism?

The ability of a message to be displayed in more than one form.

How does the behavior of a method in polymorphism depend?

The behavior of a method depends on the data provided.

What is polymorphism in Java?

The functionality of a method behaves differently in different scenarios.

What determines the methods that can be invoked on an object?

The type of the reference variable.

How is polymorphism commonly used in OOP?

When a parent class reference is used to refer to a child class object.

Can a reference variable be reassigned to other objects?

Yes, as long as it is not declared final.

Are all Java objects polymorphic?

Yes, since any object will pass the IS-A test for their own type and for the class Object.


Set pelajaran terkait

Business Characteristics- Types of Businesses

View Set

Craven ch 30- Respiratory function

View Set

Accounting Chapter #12 Intangible Assets - Class Notes/Quiz

View Set

Marieb A &P II Chap 15, 16, 17 Quiz

View Set