给 MyMethod
添加一个类型为 string
的 fname
参数。
static void MyMethod(@(6) @(5)) { Console.WriteLine(fname + " Refsnes"); } static void Main(string[] args) { MyMethod("利亚姆"); MyMethod("詹妮"); MyMethod("安雅"); }
static void MyMethod(string fname) { Console.WriteLine(fname + " Refsnes"); } static void Main(string[] args) { MyMethod("利亚姆"); MyMethod("詹妮"); MyMethod("安雅"); }