Tuesday 17 March 2015

Q 03) Polymorphism




   Poly – many.
   morph – forms.
   (In Greek )

            In a nutshell, Polymorphism is a bottom-up method call .The key benefit of polymorphism is that it is very easy to add new classes of derived objects without breaking the calling code. That uses the polymorphic classes or interfaces. When you send a message to an object even though you don’t know what specific type it is and the right thing happens that is called as " Polymorphism ".

There are 2 types of polymorphisms: -

  •    Method Overloading (Static Binding or Compile time Polymorphism )
  •         Method Overriding (Dynamic Binding or Runtime Polymorphism) 

No comments:

Post a Comment