码迷,mamicode.com
首页 > Windows程序 > 详细

C#可变参数params

时间:2019-01-04 21:22:06      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:generic   test   mon   public   []   oid   void   using   eric   

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TestParams:MonoBehaviour{
        
        private void Start(){
            test(1,2,3,4);
            test(1,4);
            
            int[] list= { 1, 2, 3, 4, 5, 6 };
            test(list);
        }
        
        private void test(params int[] list){
            
        }
        
}

C#可变参数params

标签:generic   test   mon   public   []   oid   void   using   eric   

原文地址:https://www.cnblogs.com/kingBook/p/10222306.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!