Polymorphism - Day 5 Flashcards
1
Q
What is polymorphism
A
Ability of an object to take different forms
2
Q
Two types of polymorphism
A
Static
Dynamic
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
4
Q
Method overloading summary
A
Same methods, different parameters and compiler decided which to run
5
Q
Constructor overloading
A
Same thing with methods, we can overload constructors