JSRUN 用代码说话

集合

编辑教程

VB.Net - 集合

集合类是用于数据存储和检索的专用类。 这些类提供对堆栈,队列,列表和哈希表的支持。 大多数集合类实现相同的接口。

集合类用于各种目的,例如动态地为元素分配内存以及基于索引访问项目列表等。这些类创建Object类的对象集合,Object类是VB中所有数据类型的基类 。

各种集合类和它们的用法

以下是System.Collection命名空间的各种常用类。 单击以下链接以检查其详细信息。

Class Description and Useage
ArrayList It represents ordered collection of an object that can be indexedindividually.
它表示可以单独索引的对象的有序集合。
It is basically an alternative to an array. However, unlike array, you can add and remove items from a list at a specified position using anindex and the array resizes itself automatically. It also allows dynamic memory allocation, add, search and sort items in the list.
它基本上是一个数组的替代。 但是,与数组不同,您可以使用索引在指定位置从列表中添加和删除项目,并且数组会自动调整大小。 它还允许动态内存分配,添加,搜索和排序列表中的项目。
Hashtable It uses a key to access the elements in the collection.
它使用一个键来访问集合中的元素。
A hash table is used when you need to access elements by using key, and you can identify a useful key value.
Each item in the hash table has a key/value pair. The key is used to access the items in the collection.
当您需要通过使用键访问元素时使用散列表,您可以标识有用的键值。 散列表中的每个项都有一个键/值对。 该键用于访问集合中的项目。
SortedList It uses a key as well as an index to access the items in a list.
它使用一个密钥以及索引来访问列表中的项目。
A sorted list is a combination of an array and a hash table.
It contains a list of items that can be accessed using a key or an index. If you access items using an index, it is an ArrayList, and if you access items using a key, it is a Hashtable. The collection of items is always sorted by the key value.
排序的列表是数组和哈希表的组合。它包含可以使用的键或索引访问的项的列表。如果您访问使用索引的项目,它是一个 ArrayList,和如果你访问项目使用一把钥匙,它是一个哈希表。项的集合总是按关键值排序的。
Stack It represents a last-in, first out collection of object.
它表示对象的后进先出的集合。
It is used when you need a last-in, first-out access of items. When you add an item in the list,
it is called pushing the item, and when you remove it, it is calledpopping the item.
当您需要项目的最后进入,首先访问时使用。 当您在列表中添加项目时,称为推送项目,当您删除它时,它被称为弹出项目。
Queue It represents a first-in, first out collection of object.
它表示对象的先进先出集合。
It is used when you need a first-in, first-out access of items. When you add an item in the list,
it is called enqueue, and when you remove an item, it is called deque.
当您需要项目的先进先出访问时使用。 当您在列表中添加项目时,它被称为enqueue,当您删除项目时,称为deque。
BitArray It represents an array of the binary representation using the values 1 and 0.
它表示使用值1和0的二进制表示的数组。
It is used when you need to store the bits but do not know the number of bits in advance.
You can access items from the BitArray collection by using an integer index, which starts from zero.
它用于需要存储位但不提前知道位数。 您可以通过使用从零开始的整数索引来访问BitArray集合中的项目。
JSRUN闪电教程系统是国内最先开创的教程维护系统, 所有工程师都可以参与共同维护的闪电教程,让知识的积累变得统一完整、自成体系。 大家可以一起参与进共编,让零散的知识点帮助更多的人。
X
支付宝
9.99
无法付款,请点击这里
金额: 0
备注:
转账时请填写正确的金额和备注信息,到账由人工处理,可能需要较长时间
如有疑问请联系QQ:565830900
正在生成二维码, 此过程可能需要15秒钟