楼主,你说的就是传说的方法重载。相同的方法名,他们的参数个数,类型可以不同。
eg:class test
{
void test(string arg)
{
//somecode
}
void test(string arg,int arg1)
{
//somecode
}
void test(int arg)
{
//somecode
}
}
eg:class test
{
void test(string arg)
{
//somecode
}
void test(string arg,int arg1)
{
//somecode
}
void test(int arg)
{
//somecode
}
}
public void Method(string inputValue){}
public void Method(int inputValue){}
public void Method(string inputValue1,string inputValue2){}
这是C#学的Java的地方
这是C#学的Java的地方
public string Mess(string a, string c);
public string Mess(string a, int b, string c);