为什么要使用using System.Collections.Generic
答案:2 悬赏:80
解决时间 2021-02-15 13:53
- 提问者网友:迷茫庸人
- 2021-02-15 10:48
为什么要使用using System.Collections.Generic
最佳答案
- 二级知识专家网友:深街酒徒
- 2021-02-15 11:36
引入Collections集合类的命名空间,包括:Dictionary,KeyValuePair,SortedDic tionary,SortedList,HashSet,SortedSet,List,Queue,Stack等。
1 System.Collections.Generic.Dictionary<>; //键/值对集合
2 System.Collections.Generic.KeyValuePair<>; //键/值对结构, 作为 Dictionary<> 的一个元素存在
3 System.Collections.Generic.SortedDictionary<>; //相当于 Key 能自动排序 Dictionary<>
4 System.Collections.Generic.SortedList<>; //和 SortedDictionary<> 功能相似, 但内部算法不同, 其 Keys、Values 可通过索引访问
5
6 System.Collections.Generic.HashSet<>; //无序、无重复的元素集合
7 System.Collections.Generic.SortedSet<>; //相当于能自动排序的 HashSet<>
8 System.Collections.Generic.List<>; //相当于泛型的 ArrayList, 元素可重复、可排序、可插入、可索引访问
9
10 System.Collections.Generic.Queue<>; //队列, 先进先出
11 System.Collections.Generic.Stack<>; //堆栈, 后进先出
12
13 System.Collections.Generic.LinkedList<>; //双向链表
14 System.Collections.Generic.LinkedListNode<>; //LinkedList<> 的节点
15
16 System.Collections.Generic.SynchronizedCollection<>; //线程安全的集合
17 System.Collections.Generic.SynchronizedReadOnlyCollection<>; //线程安全的只读集合
18 System.Collections.Generic.SynchronizedKeyedCollection<>; //线程安全的键/值集合
1 System.Collections.Generic.Dictionary<>; //键/值对集合
2 System.Collections.Generic.KeyValuePair<>; //键/值对结构, 作为 Dictionary<> 的一个元素存在
3 System.Collections.Generic.SortedDictionary<>; //相当于 Key 能自动排序 Dictionary<>
4 System.Collections.Generic.SortedList<>; //和 SortedDictionary<> 功能相似, 但内部算法不同, 其 Keys、Values 可通过索引访问
5
6 System.Collections.Generic.HashSet<>; //无序、无重复的元素集合
7 System.Collections.Generic.SortedSet<>; //相当于能自动排序的 HashSet<>
8 System.Collections.Generic.List<>; //相当于泛型的 ArrayList, 元素可重复、可排序、可插入、可索引访问
9
10 System.Collections.Generic.Queue<>; //队列, 先进先出
11 System.Collections.Generic.Stack<>; //堆栈, 后进先出
12
13 System.Collections.Generic.LinkedList<>; //双向链表
14 System.Collections.Generic.LinkedListNode<>; //LinkedList<> 的节点
15
16 System.Collections.Generic.SynchronizedCollection<>; //线程安全的集合
17 System.Collections.Generic.SynchronizedReadOnlyCollection<>; //线程安全的只读集合
18 System.Collections.Generic.SynchronizedKeyedCollection<>; //线程安全的键/值集合
全部回答
- 1楼网友:星痕之殇
- 2021-02-15 12:27
system.collections.generic是.net中的泛型集合
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯