Adds an item to the end of the list.
- item
- The item to add to the end of the list. (item can be null if T is a reference type.)
List<T> accepts . as a valid value for reference types and allows duplicate elements.
If List<T>.Count already equals List<T>.Capacity, the capacity of the list is increased.
If List<T>.Count is less than List<T>.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 List<T>.Count.
Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0