Code
Function Overloading [Polymorphism] in C#
polymorphism in latin word which describes 'poly' means many 'morphs' means forms.
Code
polymorphism has concept like function overloading...
Code
This example Create function Add at three times but its parameter is not same.
VB.NET
Function overloading is the process of having the same name for 
functions but having different parameters (function signatures), 
either in number or in type. Function overloading reduces the complexity
 of a program. Function overloading helps the user to use functions 
without changing its name or the return type. To overload a function 
we need to change the parameters inside the Function.





CSS

 
  Normal
  0
  
  
  
  
  false
  false
  false
  
  EN-US
  X-NONE
  X-NONE
  
   
   
   
   
   
   
   
   
   
   
   
   
  
  MicrosoftInternetExplorer4
  
   
   
   
   
   
   
   
   
   
   
   
  

 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 


 /* Style Definitions */
 table.MsoNormalTable
	{mso-style-name:"Table Normal";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-priority:99;
	mso-style-qformat:yes;
	mso-style-parent:"";
	mso-padding-alt:0in 5.4pt 0in 5.4pt;
	mso-para-margin-top:0in;
	mso-para-margin-right:0in;
	mso-para-margin-bottom:10.0pt;
	mso-para-margin-left:0in;
	line-height:115%;
	mso-pagination:widow-orphan;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";
	mso-ascii-font-family:Calibri;
	mso-ascii-theme-font:minor-latin;
	mso-hansi-font-family:Calibri;
	mso-hansi-theme-font:minor-latin;}

using Microsoft.VisualBasic;

using System;

using System.Collections;

using System.Collections.Generic;

using System.Data;

using System.Diagnostics;

partial class _Default : System.Web.UI.Page

{

public class one

{

public int i;

public int j;

public int k;

public int @add(int i)

{

//function with one argument

return i;

}

public int @add(int i, int j)

{

//function with two arguments

return i + j;

}

public int @add(int i, int j, int k)

{

//function with three arguments

return i + j + k;

}

}

protected void Page_Load(object sender, System.EventArgs e)

{

one two = new one();

Response.Write(two.@add(10));

//calls the function with one argument

Response.Write(two.@add(10, 20));

//calls the function with two arguments

Response.Write(two.@add(10, 20, 30));

//calls the function with three arguments

}

public _Default()

{

Load += Page_Load;

}

}