Skip to main content

Practice ยท 1 of 2

Four Overloads, One Winner Each

CHALLENGE
Difficulty: intermediate+25 XP

Implement four Describe overloads. Each call site in the tests must bind to the overload named in the assertion โ€” this is the compiler's betterness table in action (exact beats implicit; int? binds to int? when it exists, otherwise falls back to boxing). ``csharp static string Describe(int x); // "int" static string Describe(double x); // "double" static string Describe(int? x); // "int?" static string Describe(object? x); // "object" ``

Back to lesson: Practice: Overload Resolution Practice