Say I have these 2 functions:
public void Test(int Param1)
{
//do something
}
public void Test(int Param1, int Param2 = 1)
{
//do something
}
If I execute this: Test(2)
How does the compiler know which function to execute? It could be any of them: the first one which only accepts 1 parameter or the second one which accepts 1 or 2 parameters.
In fact I'm surprised that the above code even compiles.