List<T>.IList.Add(Object) Method

Definition

Adds an item to the IList.

 virtual int System.Collections.IList.Add(System::Object ^ item) = System::Collections::IList::Add;
int IList.Add (object item);
abstract member System.Collections.IList.Add : obj -> int
override this.System.Collections.IList.Add : obj -> int
Function Add (item As Object) As Integer Implements IList.Add

Parameters

item
Object

The Object to add to the IList.

Returns

The position into which the new element was inserted.

Implements

Exceptions

item is of a type that is not assignable to the IList.

Remarks

If Count is less than Capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.

Applies to