Method Overloading with Optional Parameter
问题 I have a class as follows with two overload method. Class A { 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; } } If I call the method x from another class with two parameters, then which method is going to execute and why? i.e, string result = new A().x("Fname", "Lname"); I've tested this in my console application and the method with 2 parameters execute. Can someone explain this? 回答1: Use of named and