Optional parameters open new possibilities for C# developers, it can cause conflicts if the method call is equivalent to several signatures.
Take for example the following methods:
public void myMethod(int i) {}
public void myMethod(int i, bool b = false) {}
public void myMethod(object o) {}What method will be called with the following statement?
myObject.myMethod(1);
The three methods correspond. The rule is that the method executed is the one whose signature best matches the parameters passed, taking into account the number of parameters and their types.
The method that will be called will be:
public void myMethod(int i) {}