C#声明方法,不知道参数数目时
class TestClass { public static void test(params int[] array) { string s; foreach (int i in array) { Console.WrriteLine(i); } } } public static void Main(string[] args) { TestClass.test("a","b","c","d"); }
赞 (0)
class TestClass { public static void test(params int[] array) { string s; foreach (int i in array) { Console.WrriteLine(i); } } } public static void Main(string[] args) { TestClass.test("a","b","c","d"); }