Академический Документы
Профессиональный Документы
Культура Документы
Polymorphism
Object oriented concept
poly + morph
poly - many
morph - different forms
Compiletime polymorphism
-action will take place at compiletime
-Method overloading
-doesnot need inheritatnce
Runtime polymorphism
-action will take place at runtime
-Method overriding
- inheritance relationship
Method overloading
class calculator
Compiletime polymorphism
Runtime polymorphism
-Method overriding is possible in only inherited classes.
-method should have same name and same parameter
Polymorphic variable
- instance variable/object variable
which takes different form