array3 = new int[] { 1, 3, 5, 7, 9 }; // OK
//array3 = {1, 3, 5, 7, 9}; // Error
值类型数组和引用类型数组
SomeType...[] array4 = new SomeType[10];
方法
修改数组中某个元素的值
int[] numbers = new int[6];
第一种:numbers.SetValue(200,...{ { 1, 2, 3 }, { 4, 5, 6 } }, { { 7, 8, 9 }, { 10, 11, 12 } } };
声明一个数组变量但不将其初始化,必须使用 new 运算符将一个数组分配给此变量...语法
很多数据的一个集合,长度可以改变,类型随便
using System.Threading.Tasks;
ArrayList list = new ArrayList();
方法
添加元素(object...(泛型集合)
语法
List list = new List();
方法
添加元素
list.Add()
添加集合元素
list.AddRange(objct[] item)
将泛型集合换为数组