Bewerken

Share via


LinkedList<T>.ICollection<T>.Add(T) Method

Definition

Adds an item at the end of the ICollection<T>.

 virtual void System.Collections.Generic.ICollection<T>.Add(T value) = System::Collections::Generic::ICollection<T>::Add;
void ICollection<T>.Add (T value);
abstract member System.Collections.Generic.ICollection<T>.Add : 'T -> unit
override this.System.Collections.Generic.ICollection<T>.Add : 'T -> unit
Sub Add (value As T) Implements ICollection(Of T).Add

Parameters

value
T

The value to add at the end of the ICollection<T>.

Implements

Examples

For an example that includes this method, see the LinkedList<T> class.

Remarks

LinkedList<T> accepts null as a valid Value for reference types and allows duplicate values.

If the LinkedList<T> is empty, the new node becomes the First and the Last.

This method is an O(1) operation.

Applies to

See also