In this article we will discuss about method overloading in C#.Net.
Also you can check out:
- Delete all stored procedures at once in SQL Server database
- What is SOAP in Asp.Net?
- Date validation using JavaScript
- Method overloading allows to create more than one method with the same name but with a different set of parameters.
When you call the method, the CLR automatically chooses the correct version by examining the parameters you supply.
- You cannot overload a method with versions that have the same signature that is, the same number of parameters and parameter data types.
- Example:
Private int GetMarks (int RollNumber)
{
//Function code will be written here
}
Private int GetMarks (string Name)
{
//Function code will be written here
}
Also you can check out:
- Delete all stored procedures at once in SQL Server database
- What is SOAP in Asp.Net?
- Date validation using JavaScript
- Method overloading allows to create more than one method with the same name but with a different set of parameters.
When you call the method, the CLR automatically chooses the correct version by examining the parameters you supply.
- You cannot overload a method with versions that have the same signature that is, the same number of parameters and parameter data types.
- Example:
Private int GetMarks (int RollNumber)
{
//Function code will be written here
}
Private int GetMarks (string Name)
{
//Function code will be written here
}