Adds an object to the end of the ArrayList.
The ArrayList index at which the value has been added.
Type Reason NotSupportedException The current instance is read-only or has a fixed size.
ArrayList accepts null as a valid value and allows duplicate elements.
If ArrayList.Count already equals ArrayList.Capacity, the capacity of the ArrayList is increased by automatically reallocating the internal array, and the existing elements are copied to the new array before the new element is added.
If ArrayList.Count is less than ArrayList.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 ArrayList.Count.