1.ArrayList
类似于数组,称数组列表,ArrayList可以动态维护,可以自动扩容。
属性:
count 获取ArrayList的元素个数
方法
Add (object value) 添加元素
RemoveAt(int index) 移除指定索引处元素
Remove(object value) 移除指定元素
Clear() 清除所有元素
2.Hashtable
称哈希表,通过键(key)和值(value)
属性:
count Hashtable中元素个数
Keys Hashtable中键的集合
Value Hashtable中值得集合
方法:
Add(object Keys,object value) 添加元素
Remove (object value) 移除指定元素
Clear() 清除所有元素
3.泛型集合
List<T>
Dictionary<keys,T>
这两个与上面两个用法对应。
泛型集合的好处:
1)效率高
2)类型安全
3)实现代码的重用