There are collection classes in C# like ArrayList, HashTable, LinkedList, Stack, Queue, etc.. Similarly, C# allows the developers to create their custom collection class.
Let's create a custom collection class called customer class with attributes.
The customer class is created with all the required attributes and all are defined in the property. C# 3.0 and above allows developers to use auto-defined properties that do not need to include any private string to use in the get and set.
The class customer is a single entity that has all the attributes of the customers. When you want to store multiple instances of the same customer then there are several ways to store them such as a List<> collection.
Similarly, the customer can have its custom collection class typically it uses the List to add, remove, etc., The CollectionBase class has to be inherited into the Customers collection class. The System.Collections namespace has the CollectionBase interface.
The Customer collection class has indexers to store the customer object in a customer's collection. It acquires all the functionality of the collection class like Insert, Delete, Add, Contains, etc.
Let us see an example of implementing the customer collection class.