---
title: "What are collections and generics?"  
description: "What are collections and generics?"  
author: "Sumit Kesarwani"  
published: 2014-09-04  
updated: 2020-09-15  
canonical: https://www.mindstick.com/interview/2130/what-are-collections-and-generics  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# What are collections and generics?

A collection can be defined as a group of related items that can be referred to as a single unit. The System.Collections namespace provides you with many classes and interfaces. Some of them are - ArrayList, List, Stack, ICollection, IEnumerable, and IDictionary. Generics provide the type-safety to your class at the compile time. While creating a data structure, you never need to specify the data type at the time of declaration. The System.Collections.Generic namespace contains all the generic collections.

## Answers

### Answer by Sumit Kesarwani

A collection can be defined as a group of related items that can be referred to as a single unit. The System.Collections namespace provides you with many classes and interfaces. Some of them are - ArrayList, List, Stack, ICollection, IEnumerable, and IDictionary. Generics provide the type-safety to your class at the compile time. While creating a data structure, you never need to specify the data type at the time of declaration. The System.Collections.Generic namespace contains all the generic collections.


---

Original Source: https://www.mindstick.com/interview/2130/what-are-collections-and-generics

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
