ArrayList list = new ArrayList();
list.Add(10);
list.Add(20);
Collection Classes have the following properties:
- Collection classes are defined as part of the System.Collections or System.Collections.Generic namespace.
- Most collection classes derive from the interfaces ICollection, IComparer, IEnumerable, IList, IDictionary, and IDictionaryEnumerator and their generic equivalents.
- Using generic collection classes provides increased type-safety and in some cases can provide better performance, especially when storing value types.