Collection Collection Collection Constructor

定义

创建并返回一个新的 Visual Basic Collection 对象。Creates and returns a new Visual Basic Collection object.

public:
 Collection();
public Collection ();
Public Sub New ()

示例

下面的示例创建一个新的 Visual Basic 集合,并将其分配coll给变量:The following example creates a new Visual Basic collection and assigns it to the variable coll:

Dim coll As New Microsoft.VisualBasic.Collection()  

Collection对象是从1开始的,这意味着元素的索引值范围从1到Count属性的值。This Collection object is one-based, which means that the index values of the elements range from 1 through the value of the Count property. Visual Basic 集合包含类型Object为的元素。Visual Basic collections hold elements of type Object.

注解

此构造函数返回的 Visual Basic 集合为空,并且没有分配任何初始容量。The Visual Basic collection returned by this constructor is empty and does not have any initial capacity allocated.

Visual Basic .NET Framework.NET Framework集合与System.CollectionsSystem.Collections.Generic和命名空间中提供的集合不兼容。System.Collections.SpecializedVisual Basic collections are not compatible with the .NET Framework.NET Framework collections available in the System.Collections, System.Collections.Generic, and System.Collections.Specialized namespaces.

适用于