P
Patrick Steele [MVP]
How can I specify default value of function parameter?
Use overloading:
public string GetInfo(int age, int type)
{
...
}
public string GetInfo(int age)
{
GetInfo(age, 5);
}
Now you can call GetInfo without supply a type and it will default to 5.