Answer: Yes, in C# 4.0, we are provided with the facility to pass parameters with default
values
Consider this example:
using System;
class Program
{
public static void mymethod(string ename="dd")
{
Console.WriteLine(ename);
}
static void Main()
{
mymethod();
}
}
//Output will be dd;
Asked In: Many Interviews |
Alert Moderator