C# Optional Parameters

Optional parameters has a default value.

//the second parameter is optional, it's default is a empty string
public void f(int i,string s="")
{
...
}
//How to use
f(3);
f(3,"good");



endmemo.com © 2024  | Terms of Use | Privacy | Home