If you need to work with multiple objects of the same type, you can use collections (see Chapter 10, “Collections”) and arrays. C# has a special notation to declare, initialize, and use arrays. Behind the scenes, the Array class comes into play, which offers several methods to sort and filter the elements inside the array. Using an enumerator, you can iterate through all the elements of the array.
If you need to use multiple objects of the same type, you can use an array. An array is a data structure that contains a number of elements of the same type.
Get Professional C# 7 and .NET Core 2.0, 7th Edition now with the O’Reilly learning platform.
O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.