So, till this moment you saw some common scenarios about OOPs and its related concepts. Basically the premier use of OOPs programming methodology is to employ Resuability,
Security,
Allow to focus on data,
Manageability
Protability etc.
So friends, lets move further and do take a look on overloading of methods in C#.
Security,
Allow to focus on data,
Manageability
Protability etc.
So friends, lets move further and do take a look on overloading of methods in C#.
It would not be much difficult as we have already assumed.
Straightforwardly, few things about overloading.
-> When there are two or more
than two methods, and with same name but different signature are available -
known as method overloading.
-> These function could have
same return type or different does not create any difference for
overloading.
public void
demoOverload(int y){}
public int demoOverload(int y, int z){}
-> Main thing which we should concentrate about, is how we define different number of parameter for a method which share same name for all available methods.
public void
demoOverload(int y){}
public void demoOverload(double y){}
public void demoOverload(string val){}
or
public double
demoOverload(double y, double z){}
-> Now, when ever you want to
make a call to your desired method just create an object of that class and then
call the method name
with the appropriate parameters
input.
e.g.
object.demoOverload("hello world");
Hope this demonstration will help you in understanding the method overloading concept in easy steps.
Thanks!!
[Note:
* You all are
welcome to express your views as comment in the box given below of this
post.
* I have not
made any special conditions to write here your comment but you may write
whatever your heart speak out loud in your inner-self.
* This blog
space is continuously in writing/edit mode, kindly keep visiting for a full
version]
Post related to CSharp programming
- Basics of OOPs (Object Oriented Programming System)
- Straightforward points about Overriding
- C# Method Overloading- in few simple steps with example
- Talking about C# Interface: in few simple straightforward steps
- C# code Abstract method- In few simple straightforard steps
- Select start up project in just 3 steps in visual studio
- Starting with array variable
- whether to press F5 or ctrl+F5 to execute my program.
- How to write c sharp program in 8 simple steps using Visual Studio
- Catching the value of any Kind of Dialog Boxes
- Line Number along with Code in VS2008 / VS2010 / VS2012
No comments:
Post a Comment