Adds an object to the end of the ArrayList.
[Visual Basic] Overridable Public Function Add( _ ByVal value As Object _ ) As Integer [C#] public virtual int Add( object value ); [C++] public: virtual int Add( Object* value ); [JScript] public function Add( value : Object ) : int;
The new number of elements in the ArrayList (Count) after value has been added.
Exception Type | Condition |
---|---|
NotSupportedException | The ArrayList is read-only.
-or- The ArrayList has a fixed size. |
This method can be overridden by a derived class.
If Count already equals Capacity, the capacity of the list is doubled by automatically reallocating the internal array, before the new element is added.
ArrayList Class | ArrayList Members | System.Collections Namespace | Count | Insert | AddRange