If you need to store multiple values in a variable, then you can use a collection.
A collection is a data structure in memory that can manage multiple items in different ways, although all collections have some shared functionality.
There are three main assemblies and namespaces for collections:
System.Collections.dll
assembly andSystem.Collections.Generic
namespace: The types in this assembly and namespace were introduced in C# 2 with .NET 2.0 and are better because they allow you to specify the type you want to store (which is safer, faster, and more efficient).System.Collections.Concurrent
assembly and namespace: the types in this assembly and namespace are safe to use in multi-threaded scenarios (see Chapter 12, Improving Performance and Scalability with Multitasking).System.Collections.Immutable
assembly and namespace: the types in this assembly and namespace are designed for scenarios where the contents of the collection should never change.
All collections...