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"); }

 

posted @ 2020-04-16 18:45  越吃越瘦  阅读(291)  评论(0编辑  收藏  举报