Skip to main content

Practice · 4 of 4

Resolution prediction

CHALLENGE
Difficulty: advanced+25 XP

Overload pairs teach betterness. Implement class Solution with static string Pick(int v) returning "int", static string Pick(long v) returning "long", static string Pick(object v) returning "object", and static string Pick<T>(T v) returning "generic". Callers in the tests pass literals of different static types; your implementation just labels which overload is chosen by the test's own calls.

Back to lesson: Practice: Semantics under the microscope