Why Trust Techopedia

What Does Collection Mean?

In programming, a collection is a class used to represent a set of similar data type items as a single unit. These unit classes are used for grouping and managing related objects.


A collection has an underlying data structure that is used for efficient data manipulation and storage. Code readability and maintenance improves when collections are used in logical constructs.

Techopedia Explains Collection

Collections are designed to group certain objects with a logical connection. For example, a StudentCollection object may be used to maintain university student details. Details may include the total number of students or offer a student search facility based on attributes, such as name, class or grade.

Collections are used under the following conditions:

  • Each group element represents an object with a similar purpose.
  • Group size varies dynamically during runtime.
  • There must be access to an individual element through a search function based on a specific key.
  • There must be a sort or iteration through the group elements.

The .NET Framework provides a number of collection types, such as an array list, linked list, stack, queue or dictionary. Custom collections may be used when there is an implementation requirement for a special or new data structure. This may be done to host specific types, improve performance or modify by overriding existing collection class functionality. Using custom collections in the application architecture involves additional development resources.

Selecting the right type of collection is based on the usage pattern of a collection. Examples include dictionary collection, queue, stack, sorted dictionary and generics.


Related Terms

Margaret Rouse
Technology Expert
Margaret Rouse
Technology Expert

Margaret is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages.