Collection namespaces:
Using. System.Collections; (non-generic collection)
Using. System.Collections.Genneric (Generic collection)
Common collections
1. "Array-like" collection:ArrayList, list<t>
2. "Key-value pairs" collection ("Hash Table" collection):hashitable, dictionry<k,v>
3. "Stack" collection: Stack, stack<t> (LIFO) last Infirst out
4. Queue collection: Queue, queue<t> (FIFO) first in first out
A collection of blue collections that are used primarily.
ArrayList Count and Capcity one is the number of elements, a number of capacity, when stored in an element count=1 capacity of 4, save the second time count=2 capacity=4
When deposited in the 5th, Count=5 Capacity=8, because the capacity initial capacity of 4, when the capacity reached 4 times doubled.
Array loop traversal with length and count plus indexer when set
Inserts an element into the specified position
adding elements
Arrlist. Insert (0, "the Emperor");
add Element-
Arrlist.addrange (); The method parameter is the ICollection interface. In other words, this parameter can pass the subclass of the integrated ICollection interface, which has many subclasses, which are basically collections and arrays
Arrlist.addrange (new int []{1,2,4,5,87,93,5});
Delete Element
Arrlist. Removeat (0);
Arrlist. Removeatrange ();
. The collection in net