I\'m reading a book for C# and I\'m in the chapter of named and optional parameters. I\'ve read a bullet where it says:
\"If multiple optional paramet
It simply means that optional parameters must all be last in the parameter list.
public void Method(int param1, int param2 = 0, int param3 = 0)
{
//This works
}
versus
public void Method(int param1 = 0, int param2 = 0, int param3) //Param3 isn't optional.
{
//This does not!
}
public void Method(int param1 = 0, int param2, int param3 = 0) //Param2 isn't optional.
{
//Neither does this!
}