0
Hi
Overloading:
int Area( int len, int height) // Area of rectangle
Ex: Let suppose you want to calculate area of all geometry like square, rectangle, square etc.
Here method name is same for all geometry but signatures are different.
Overriding:
Let suppose you want o use same method every where but only method
definition will be different.
Ex: Result();
Here result is common method which will be implemented by all class with different definitions.
Result will display different value for different classes.
0
Thanks Guys...
This clears a doubt a bit. Please reply in case you have more info on this.
0
Best example is ToString method .
You can override the same according to your need.
0
Hi,
Ok, Check this reference :
http://csharpindepth.com/Articles/General/Overloading.aspx
0
Thanks Nishant & Rajeesh,
I got it conceptually but looking for a strong scenario where we have to use overloading or overriding. Overlaoding is simple for that matter but desparately looking for overriding scenario
0
Hi,
Just check this Reference :
http://www.aspdotnet-suresh.com/2013/09/polymorphism-in-c-with-example-types-of-polymorphism.html
http://www.aspdotnet-suresh.com/2013/09/polymorphism-in-c-with-example-types-of-polymorphism.html
0
Hi Vivek
When you want to provide your defination to the existing method, then you have to use Overriding and when you have to use same functionality with different no. of parameters you have to go for Overloading..