Thursday, October 13, 2011

Polymorphism

- It allows you to invoke methods of derived class through base class reference during runtime.

- It has the ability for classes to provide different implementations of methods that are called through the same name.

Types of Polymorphism

1. Compile time polymorphism/Overloading/Early Binding

2. Runtime polymorphism/Overriding/Late Binding

- Change the behavior of the method for the derived class

Compile time polymorphism/Overloading/Early Binding

- Performs the different task at the different input parameters.

Runtime polymorphism/Overriding/Late Binding

- Change the behavior of the method for the derived class

- Versioning of a method is called as runtime polymorphism

No comments:

Post a Comment