Introducing the System.Collections.Generic namespace
The generic collection classes that we will present in this chapter are a part of the .NET Base Class Library (BCL) and are all available under the System.Collections.Generic
namespace. This namespace contains interfaces and classes that define generic collections and operations. All the generic collections implement a series of generic interfaces, which are also defined in this namespace. These can be broadly grouped into two categories:
- Mutable, which support operations for changing the content of the collection such as adding new, or removing existing elements.
- Read-only collections, which do not provide methods for changing the content of the collection.
The interfaces that represent mutable collections are as follows:
IEnumerable<T>
: This is the base interface for all the other interfaces and exposes an enumerator that supports iterating through the elements of a collection ofT
type.ICollection...