C# Tutorial - Generic Collection Namespace

Generic Collection Namespace

The System.Collections.Generic namespace contains interfaces and classes that define generic collections, which allow users to create strongly typed collections that provide better type safety and performance than non-generic strongly typed collections.


Comparer Provides a base class for implementations of the IComparer generic interface.
Dictionary Represents a collection of keys and values.
HashSet Represents a set of values.
LinkedList Represents a doubly linked list.
List Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.
Queue Represents a first-in, first-out collection of objects.
SortedList Represents a collection of key/value pairs that are sorted by key based on the associated IComparer implementation.
Stack Represents a variable size last-in-first-out (LIFO) collection of instances of the same specified type.


Dictionary.Enumerator Enumerates the elements of a Dictionary.
HashSet.Enumerator Enumerates the elements of a HashSet object.
LinkedList.Enumerator Enumerates the elements of a LinkedList.
List.Enumerator Enumerates the elements of a List.
Queue.Enumerator Enumerates the elements of a Queue.


ICollection Defines methods to manipulate generic collections.
Comparer Defines a method that a type implements to compare two objects.
IDictionary Represents a generic collection of key/value pairs.
IEnumerable Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
IEnumerator Supports a simple iteration over a generic collection.
IList Represents a collection of objects that can be individually accessed by index.
IReadOnlyCollection Represents a strongly-typed, read-only collection of elements.
ISet Provides the base interface for the abstraction of sets.