数组参数 有params 区别

public static void testnotparams(int[] par)
{

}

//-----------------------------------------------------------------------------------------------------
public static void test(params int[] par)
{

}
void dfsasa()
{

testnotparams(1, 2);//不可以赋值
testnotparams(new int[] { 1, 2 });

test();
test(new int[] { 1, 2 });
test(1, 2);

}

posted on 2016-09-10 21:52  WINSH  阅读(414)  评论(0编辑  收藏  举报

导航