Polymorphism - Day 5 Flashcards

1
Q

What is polymorphism

A

Ability of an object to take different forms

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Two types of polymorphism

A

Static

Dynamic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Static polymorphism

A

Achieved using overloading of the methods in the same class. (Method overloading)

Allows the programmer to have multiple methods with the same name in the same class but differ in their signature; differ by # of parameters, datatype of parameter and order of parameters

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Method overloading summary

A

Same methods, different parameters and compiler decided which to run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Constructor overloading

A

Same thing with methods, we can overload constructors

How well did you know this?
1
Not at all
2
3
4
5
Perfectly