.NET Collections

A general problem is the need to deal with several objects at once and to somehow keep track of them. There is never one employee, or one car, or generally one of anything. To this end, .NET provides several generic collections in the System.Collections namespace.

Collections in C# implement the IEnumerable interface. The IEnumerable interface allows for traversal over the elements contained with a given collection. The following collections will be covered in brief: stack, queue, and hashtable. Along with these basic collections, an implementation of a linked list that implements the IEnumerable interface and provides an IEnumerator for the elements is also presented.

For detailed information about generic collections, data ...

Get C# and the .NET Framework: The C++ Perspective now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.