ArrayList contains a simple list of values and very easily we can add , insert , delete , view etc. The capacity of a ArrayList is the number of elements the ArrayList can hold. As elements are added to an ArrayList, the capacity is automatically increased as required through reallocation.The capacity can be decreased by calling TrimToSize or by setting the Capacity property explicitly.
The ArrayList collection accepts Nothing as a valid value, allows duplicate elements. It is very flexible becuse we can add without any size information , that is it grow dynamically and also shrink .vb.net
Dim aList As New ArrayList aList.Add("Sunday")
ArrayList aList = new ArrayList(); aList.Add("Sunday");
We can insert items in an ArrayList with a specified index
For removing items from an ArrayList , we can use ArrayList.Remove(object)
An ArrayList can also be sorted alphabetically or numerically with the Sort() method.
The following ASP.NET program add seven days in a week to an ArrayList and bind it to a ListBox control.
Click the following links to see full source code