What is Method?
Method is a code block where the actual job is done & having programming logic. In other word the block of code which is created for a particular job that can be accessed from anywhere in the Program.
Method declaration:
Public void mymethod ( ) //Access modifier return type method name (parameter list)
{
// method scope start.
//Area for code
} // method scope finish
Parameters:
Suppose we create method for squiring a number, for this we need a variable that take the number in it & further solve it. The variable that take number is defined in parameter list when method declares.
Arguments:
The values that pass from the parameter list is known as argument.
For Example:
- class Mathametics
- {
- public int getproduct (int x,int y)
- {
- return x * y;
- }
- }
Method Signature:
The compiler use the method signature to identify the methods found in a single class.
There are two definitions related to method signature,
- Microsoft definition
- Internet definition
Now we will discuss both one by one.
Microsoft definition
The method signature is the combination of return type, method name & parameter list. The combination of these 3 must be different in a Program.
Internet definition
The combination of method name & parameter list called internet defined method signature.
I must go with Microsoft define method signature.
If we declare more than one method having same method signatures then the following error occurs,
Method Calling
After declaration of method in class the next step is to use it in the main scope of the program, for this we need first to create object in main body & the object created by “new” keyword.
//class name object name= new class name( );
Mathametics math = new Mathametics();
Then,
Object name. (All thepublic methods define in class show in Intel license window).

Types of Method
There are four types of methods defined in C-Sharp language.
- Take input ,Process, give output
- Take input, Process, give no output
- Take no input, Process, give output
- Take no input, Process, give no output
Take input, Process, gives Output:
- public int getproduct (int x,int y)
- {
- return x * y;
- }
- public void getproduct(int a, int b, int c)
- {
- Console.Write("The Product is {0}" + a * b * c);
- }
- public int getdiv()
- {
- int x = int.Parse(Console.ReadLine());
- int y = int.Parse(Console.ReadLine());
- return x / y;
- }
- public void getdiv()
- {
- }
In simple words the methods which are accessed without object is called non-instance methods, while the objects necessary for accessing the methods are called instance methods.

Yuva VPosted Sep 28, 2015, 2:34 AM
gud one
Vignesh ManiPosted Sep 20, 2015, 5:47 AM
Nice
Saineshwar BageriPosted Sep 20, 2015, 1:01 AM
nice one
Sibeesh VenuPosted Sep 17, 2015, 6:25 AM
Nice Share
Ankit BansalPosted Sep 17, 2015, 4:33 AM
thanks for share..
Anil KumarPosted Sep 17, 2015, 1:47 AM
well Defined..
Rajeesh MenothPosted Sep 17, 2015, 12:36 AM
Simple and Informative..
Pankaj Kumar ChoudharyPosted Sep 16, 2015, 8:33 PM
Nice Start Yaseen.........
Mohammed IbrahimPosted Sep 16, 2015, 2:29 PM
nice
Karthikeyan KPosted Sep 16, 2015, 12:24 PM
Good one
Shakti SaxenaPosted Sep 16, 2015, 9:30 AM
nice
Vaikesh K PPosted Sep 16, 2015, 8:57 AM
Good One
Raja TPosted Sep 16, 2015, 8:31 AM
Nice, Thanks for sharing
RakeshPosted Sep 16, 2015, 8:10 AM
Good one
Harshad PansuriyaPosted Sep 16, 2015, 7:48 AM
Nice One
Vipul MalhotraPosted Sep 16, 2015, 6:44 AM
nice