当前位置:健康减肥瘦身 > 瘦身减肥 > 数组的八种创设方法

数组的八种创设方法

文章作者:瘦身减肥 上传时间:2019-12-01

第一种:

string[] myArray = new string[10];

for(int i = 0; i<10;i++){

  myArray[i] = i+1;

}

第二种:

string[] myArray2 = {"1","2","3","4","5","6","7","8","9","10"};

第三种:

string[] myArray = new string[10]{"1","2","3","4","5","6","7","8","9","10"};

第四种:

string[] myArray = new string[]{"1","2","3","4","5","6","7","8","9","10"};

本文由健康减肥瘦身发布于瘦身减肥,转载请注明出处:数组的八种创设方法

关键词: