0
我在一個情況下,我需要有兩個重載看起來應該是這樣一個方法,重載方法類似簽名
void myMethod(string myParam)
{
// Some code to process myParam
}
void myMethod(string otherParam)
{
// Another code to process otherParam
}
不幸的是C#編譯器不允許這種超載,因爲它認爲兩個重載具有相同的簽名,如果要爲參數表示不同的含義,您將有不同的名稱。
我不知道該如何處理這種情況?