O'Reilly logo

VB.NET Core Classes in a Nutshell by Ted Neward, Budi Kurniawan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

ArrayList

Synopsis

This class is similar to an array, but it can grow or shrink as needed. The Capacity property returns the maximum number of elements the ArrayList can hold. You can reduce the size by setting Capacity explicitly or using the TrimToSize() method. An ArrayList can be constructed empty or with an integer argument that sets its initial size. You can also pass the constructor an object that implements ICollection to fill the ArrayList with the contents of that object.

A number of methods are provided to modify the contents of the ArrayList. The Add() and AddRange() methods add elements to the end of the list. Insert() and InsertRange() add new elements at a specified location within the list.

Public Class ArrayList : Implements IList, ICollection, IEnumerable, ICloneable
' Public Constructors
   Public Sub New() 
   Public Sub New( ByVal c As ICollection) 
   Public Sub New( ByVal capacity As Integer) 
' Public Instance Properties
   Overridable Public Property Capacity As Integer  
   Overridable Public ReadOnly Property Count As Integer 
   Implements ICollection.Count 
   Overridable Public ReadOnly Property IsFixedSize As Boolean Implements IList.IsFixedSize 
   Overridable Public ReadOnly Property IsReadOnly As Boolean Implements IList.IsReadOnly 
   Overridable Public ReadOnly Property IsSynchronized As Boolean Implements ICollection.IsSynchronized 
   Overridable Public Default Property Item(
        ByVal index As Integer) As Object Implements IList.Item 
   Overridable Public ReadOnly Property SyncRoot ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required