Pages

Men

rh

7/01/2012

Difference between Overloading and Overriding in C#


Difference between Overloading and Overriding:

Overloading:
  • Providing new implementation with same name and different signatures.
  • Overloading can be done in same class.
  • No separate keyword is used to implement Overloading. 
  • Used to implement Static Polymorphism.

Overriding:
  • Providing new implementation with same name and same signature.
  • Overriding can be done in base class and derived class
  • Use Virtual keyword for base class function an override keyword in derived class function to      implement overriding.
  • Used to implement Dynamic Polymorphism.

No comments :

Post a Comment