您的位置:首页 > 编程语言 > C#

C# 集合类型

2015-08-15 14:29 316 查看
数组,arrayList   List<>

Hashtable

Hashtable ht = new Hashtable();
ht.Add("first","xuanxuan");
ht.Add("second","minmin");
//通过这样访问ht["second"]
使用无效的key查找是返回null  而dictionnary抛出异常

Hashtable类型不安全,使用Dictionary

Dictionary<类型,类型> d = new Dictionary<类型,类型>();

Dictionary不是线程安全的,,ConcurrentDictionary是线程安全的

SortedList<类型,类型>根据key排序
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: