ArrayList:長度可變數組,不限定類型
ArrayList al = new ArrayList();
↓
List:替代ArrayList,限定類型
List list = new List<int>();
Hashtable:哈希表,不限定類型
Hashtable ht = new Hashtable();
↓
Dictionary:替代Hashtable,限定類型
Dictionary<string, string> d = new Dictionary<string, string>();
SortedList:可排序的列表
SortedList<int, int> sl = new SortedList<int, int>(); sl.Add(5, 105); sl.add(2, 102); sl.Add(10, 99); foreach(var v in sl){ Cosole.WriteLine(v.Value); } // 最終排序:key值會從小到大排序