System.Collections Namespace

Provides interfaces and classes that define non-generic collections of objects. This namespace includes types that support the basic collection interfaces, such as lists, dictionaries, hash sets, and queues.

Types

Classes

Interfaces

The System.Collections namespace defines several fundamental interfaces for collections:

Classes

This namespace also provides several concrete classes that implement these interfaces, offering common collection functionalities:

ArrayList

Implements a dynamic array of objects. It can grow or shrink as needed.

public class ArrayList : IList, ICollection, IEnumerable

Hashtable

Implements a collection of key-value pairs that are organized based on the hash code of the keys. Offers efficient lookups.

public class Hashtable : IDictionary, ICollection, IEnumerable

Queue

Represents a first-in, first-out (FIFO) collection of objects.

public class Queue : ICollection, IEnumerable

Stack

Represents a last-in, first-out (LIFO) collection of objects.

public class Stack : ICollection, IEnumerable

SortedList

Implements a collection that maintains a sorted list of elements, where each element is a key/value pair. Keys are sorted and can be accessed by index.

public class SortedList : IDictionary, ICollection, IEnumerable

CollectionBase

Provides a base class for creating custom collection classes. It simplifies implementing the IList and ICollection interfaces.

public abstract class CollectionBase : IList, ICollection, IEnumerable

DictionaryBase

Provides a base class for creating custom dictionary collection classes. It simplifies implementing the IDictionary and ICollection interfaces.

public abstract class DictionaryBase : IDictionary, ICollection, IEnumerable

ReadOnlyCollectionBase

Provides a base class for custom read-only collection classes. Objects in a read-only collection cannot be modified.

public abstract class ReadOnlyCollectionBase : ICollection, IEnumerable

CaseInsensitiveComparer

Compares two objects for inequality using case-insensitive string comparison.

public class CaseInsensitiveComparer : IComparer

CaseInsensitiveHashCodeProvider

Provides a hash code implementation that is insensitive to case for string keys.

public class CaseInsensitiveHashCodeProvider : IHashCodeProvider

Namespace: System

Assembly: mscorlib.dll

Last Updated: October 26, 2023