I have a class as follows with two overload method.
public string x(string a, string b)
return "hello" + a + b;
public string x(string a, string b, string c = "bye")
return c + a + b;
string result = new A().x("Fname", "Lname");
If two candidates are judged to be equally good, preference goes to a candidate that does not have optional parameters for which arguments were omitted in the call. This is a consequence of a general preference in overload resolution for candidates that have fewer parameters.
Implying the above rule method with 2 parameters
string x(string a,string b) will be called.
Note: If both overloaded methods have optional parameters then compiler will give run-time ambiguity error.