[9] Polymorphism

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/11

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

12 Terms

1
New cards

Polymorphism

What allows performing of a single action in a different ways?

2
New cards

(1) Static

(2) Dynamic

What are the types of polymorphism?

(1) […]

(2) […]

3
New cards

Static Polymorphism

Flow of control is decided during compile time.

4
New cards

Static Polymorphism

It is achieved through method overloading.

5
New cards

Dynamic Polymorphism

Flow of control is decided during runtime.

6
New cards

Dynamic Polymorphism

It is achieved through method overriding.

7
New cards

casting

You can change the existing type of an object reference to another type through […].

8
New cards

(1) Upcasting

(2) Downcasting

Types of Object Casting:

(1) […]

(2) […]

9
New cards

Upcasting

What is casting from a subclass to a superclass?

10
New cards

Downcasting

What is casting from a superclass to a subclass?

11
New cards

exception

runtime

instance

Rules in casting objects:

(1) The compiler will not allow casts to […].

(2) Even when the code compiles without issue, an […] may be thrown at […] if the object being cast is not actually an […] of that class.

12
New cards

(1) same signature

(2) as accessible or more accessible

(3) new or broader

Rules in Overriding Methods:

(1) The method in the child class must have the […] as the method in the parent class.

(2) The method in the child class must be at least […] or […] than the method in the parent class.

(3) The method in the child class may not throw a checked exception that is […] or […] than the class of any exception thrown in the parent class method.