一、C#常用的容器:
Array:数组,用下标取值
案例:int[] arr = new int[num];
ArrayList:列表,用下标取值,需要装箱和拆箱
案例:ArrayList arr = new ArrayList();
HashTable:hash表,键值对取值,需要装箱和拆箱
案例:HashTable table = new HashTable();
List<T>:泛型列表,用下标取值,需要指定类型
案例:List<int> list = new List<int>();
Dictionary<T,T>:字典,泛型hash表,键值对取值
案例:Dictionary<string,string> dic = new Dictionary<string,string>();
DataTable:表格,坐标取值(第几行第几列,或者第几行的什么字段,类似于二维数组)
案例:DataTable table = new DataTable();