Polymorphism :
Entities can behave different ways depending upon the input it receives it can be implement it object -oriented programming using overloading and overriding.
polymorphism can be Clasified into two types :
- Static or Compile Polymorphism
- Dynamic or Runtime Polymorphism
In the 2nd case the object of the class recognizes which polymorphic method it has to call only in run time. Where method overriding and method hiding comes under Dynamic or run time polymorphism.
overloading :
This allows to define multiple methods in a class with the same name by changing their signatures
overloading is the two types :
- Method overloading
- Constructor overloading
If a method of a class is redefine under it's child class with the same signature.it's known as method overriding.
No comments:
Post a Comment