How to minimize the Method Overloading in C# 4.0
We can avoid creating many overloads of a method by specifing default values for some parameters. public static void EmployeeDetails(int empId, string address=”BBSR”, double salary=15000) { } static void Main(string[] args) { EmployeeDetails(1); EmployeeDetails(1, “Cuttack”); EmployeeDetails(1, “Cuttack”, 20000); } In the above Example there is a method called EmployeeDetails which has 3 parameters including […]