1:当一个方法的某一个参数个数不固定的时候,可以使用Param
2:可变的方法参数必须定义为数组类型
3:该参数必须放在方法参数的最后,应且只有一个
4:参数必须为一维数组
5:params不能和ref和out组合使用
namespace ConsoleApp2
{class Program{static void Main(string[] args){show(1,new string[]{"1","1","1" });show2(2, "A", "B", "C");}static void show(int age,string[] array){foreach (var item in array){}}static void show2(int age,params string[] array){foreach (var item in array){}}}
}