VB.NET中的集合类型 [英] Collection Types in VB.NET
本文介绍了VB.NET中的集合类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一些关于arraylist,hashtable,stack,queue,namevaluecollections的概念.
谁能告诉我它们的实际应用.
我在Google中尝试过,但可以找到完全匹配的内容.
感谢您的时间.
Hello All,
I got some concepts regarding arraylist, hashtable, stack, queue, namevaluecollections.
Could anyone tell me the practical applications of each.
I tried in google but could find exact match.
Thanks for your time.
推荐答案
ArrayList
是任何类型的对象的集合,由于装箱和拆箱的性能而不能使用,应该使用List< ; T>反而.通常,您可以使用它来按原样存储和迭代.
Hashtable
是基于密钥的快速存储和检索的集合.
Stack
是后进先出结构.
Queue
是先进先出结构.
NameValueCollection or Dictionary
非常类似于HashTable.
ArrayList
is a collection for any type of object, which should not be used because of boxing and unboxing performance, you should use List<T> instead. You usually use this for storing and iterating over as is.
Hashtable
is a collection for rapid storing and retrieval based on the key.
Stack
is a Last in First Out structure.
Queue
is a First in First Out structure.
NameValueCollection or Dictionary
is much like a HashTable.
完全同意Mehdi的解决方案.另外,您可能会发现有用的一些链接:
- .NET集合的比较 [备忘单:常用操作的速度 [
Fully agree on Mehdi''s solution. Also few links you may find useful:
- A Comparison of .NET Collections[^]
- Cheat Sheet: Speed of Common Operations[^]
这篇关于VB.NET中的集合类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文