.NET API Reference

Microsoft Documentation

System.Collections Namespace

This namespace contains interfaces and classes that define various collections of objects. It includes non-generic collections like ArrayList and Hashtable, as well as interfaces that are foundational for generic collections. These types are essential for managing groups of objects in a structured way, offering flexibility and efficiency for data storage and retrieval.

Classes and Interfaces

ICollection Interface

Represents the base interface for all non-generic collection types. It provides common properties and methods for accessing the number of elements in a collection, whether it is synchronized, and copying elements to an array.

public interface ICollection : IEnumerable

IEnumerable Interface

Implements the enumerator, which supports a simple iteration over a non-generic collection.

public interface IEnumerable

ArrayList Class

Represents a strongly-typed list of objects that can be accessed by index. Provides methods for creating, searching, and sorting lists. Unlike an array, an ArrayList can grow or shrink dynamically.

public class ArrayList : IList, ICollection, IEnumerable

Hashtable Class

Represents a collection of key and value pairs that are organized by hash code. This is a non-generic collection that stores objects of type Object.

public class Hashtable : IDictionary, ICollection, IEnumerable

IDictionary Interface

Represents a collection of key/value pairs. The keys are used to access the values.

public interface IDictionary : ICollection, IEnumerable

IEnumerator Interface

Supports a simple iteration over a non-generic collection.

public interface IEnumerator

Stack Class

Represents a LIFO (Last-In, First-Out) collection of objects. It is a non-generic collection.

public class Stack : ICollection, IEnumerable

Queue Class

Represents a First-In, First-Out (FIFO) collection of objects. It is a non-generic collection.

public class Queue : ICollection, IEnumerable