Getting the ambiguous call as arrangement of parameters are different: short,int / int,short /byte,int / int,byte
As Function signature is:
1.Number of arguments/parameters
2.Type of arguments/parameters
3.Arrangement of arguments/parameters
Why the call is ambiguous ? should it belongs to the similar type ?...
code:
class Program
{
static void Main(string[] args)
{
test abbb = new test();
//abbb.add(2.2f,1);
// abbb.add(2,2.2f);
abbb.add(255,1);
abbb.add(1,256);
Console.ReadLine();
}
}
class test
{
public int add(byte i , int f) {
return i + f;
}
public int add(int i, byte f)
{
return i + f;
}
public int add(short i, int f)
{
return i + f;
}
public int add(int i, short f)
{
return i + f;
}
}