Which pair of methods would NOT be valid overloads in the same C# class?
Correct answer C. int Get(int x) and string Get(int x)
Explanation
Overloads must differ in their signature, which consists of the method name and the number, types and kinds (ref, out, in, value) of parameters. The return type is not part of the signature, so two methods that differ only in return type clash. Changing a parameter type, adding a parameter or switching between value and ref all produce valid overloads.
Answer checked How we write and check questions
Discussion