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