System.Collections Namespace
Provides interfaces and classes that define collections of objects, such as lists, queues,
arrays, hash tables, and dictionaries. This namespace includes both non-generic
collections (like ArrayList
and Hashtable
) and generic collections
(like List<T>
and Dictionary<TKey, TValue>
).
Interfaces
-
Interface
IEnumerable
interface IEnumerableRepresents the enumerator, which supports a simple iteration over a non-generic collection.
-
Interface
ICollection
interface ICollectionRepresents the root of the non-generic collection hierarchies. Provides the base interface for deriving specialized, domain-specific collection interfaces.
-
Interface
IList
interface IListRepresents a non-generic collection of objects that can be individually accessed by index.
-
Interface
IDictionary
interface IDictionaryRepresents a non-generic collection of key/value pairs.
Classes
-
Class
ArrayList
class ArrayList : ICollection, IEnumerable, IListRepresents a non-generic collection of objects that can be individually accessed by index. The size of the ArrayList is automatically increased as elements are added.
-
Class
Stack
class Stack : ICollection, IEnumerableRepresents a LIFO (Last-In, First-Out) collection of objects.
-
Class
Queue
class Queue : ICollection, IEnumerableRepresents a LIFO (Last-In, First-Out) collection of objects.
-
Class
Hashtable
class Hashtable : ICollection, IDictionary, IEnumerableRepresents a collection of key-value pairs that are organized based on the hash code of the key.
Enumerations
-
Enum
CollectionChange
enum CollectionChangeSpecifies the type of change that occurred in a collection.