In C#, generics are used to create classes, methods, structs and other components that are not specific, but general. This allows us to use the generic component for different reasons. For example, if you have a general-purpose soap, you can use that soap for any kind of washing. You can use it to wash your hands, to wash your clothes, or even to wash your dirty dishes. However, if you have a specific category of soap, such as laundry detergent, it can only be used for washing clothes and not for any other thing. Consequently, generics give us some extra power of re-usability in our code, which is good for an application as there would be less code which does similar work. Generics are not newly developed; they has been available since C# 2. So, with so many years of usage, generics have become commonly used by programmers.
Let's take a look at an example...