Chapter 7: Collections

In the previous chapter, we learned about generic programming in C#. One of the most important applications of generics is creating generic collections. A collection is a group of objects. We learned how to use arrays in Chapter 2, Data Types and Operators. However, arrays are sequences of a fixed size and in most cases, we need to work with sequences of variable size.

The .NET frameworks provide generic classes that represent various types of collections, such as list, queue, set, map, and others. Using these classes, we can easily perform operations such as insert, update, delete, sort, and search on a collection of objects.

You will learn about the following generic collections in this chapter:

  • The List<T> collection ...

Get Learn C# Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.