Question: Given the following two method signatures, explain the reasoning behind how the C# compiler determines which method version to invoke for the call MyMethod(12)

Given the following two method signatures, explain the reasoning behind how the

Given the following two method signatures, explain the reasoning behind how the C# compiler determines which method version to invoke for the call MyMethod(12) (note: assume both methods coexist): private static void MyMethod(int a) private static void MyMethod (int a, char b = 'B') The first version is better because no optional parameter are omitted The second version is better because there are optional parameters Both method signatures are equal None of the method signatures are valid

Step by Step Solution

3.42 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The correct choice for the above question is option a that is The first version is better because no ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!