Overloading :
- Overloading is an approach of defining multiple methods with the same name changing their signature.
- This can be done within the class as well as child class also.
- To overload a method in the child class we don't require any permission from parent class.
- Overriding is an approach of defining multiple methods with the same name and same signature.
- This can be done only within the child class.
- To override a method in the child class we require an explicit permission from permission from parent class.
signature is nothing but a changing the signature in the sense we can either change the number of parameters being passed to the method (or) type of parameter pass to method (or) order parameter being passed to the method.
example :
- public void show();
- public void show(int x);
- public void show(string x);
- public void show(int x, int y);
- public void show(string x, int x); and soon......
nice post..but have to give more example on it
ReplyDeletehttp://csharpektroncmssql.blogspot.com
method overloading in child class????
ReplyDeletewhats this?
More about....Difference between method overloading and method overriding
ReplyDeleteLing