集合 数组

数组  都继承于System.Array

int[] numbers = new int[5];
string[,] names = new string[5,4];
byte[][] scores = new byte[5][];
scores[1] = new byte[10];//数组的数组
//[,]是规则数组,每行的列元素都是相同的,变现为矩阵
//[][]是不规则矩阵,每行的列数都是可以不一样的


初始化

int[] numbers2 = new int[]{1,2,3,4,5};
int numbers3 = {1,2,3,4,5};
string[,] names = {{"g","k"},{"h","j"}};

首页 我的博客
粤ICP备17103704号