In this article, we are going to talk about the use of Generics in C# with examples.
What is Generic in C#
Generic in C# was introduced in.NET Framework 2.0, it is basically enhancement of collection which makes our code type independent so that we can reuse our code with different data types.
For example, List in C# is a generic collection that can be used with the different data type, such as List<int>, List<float>, List<string>, or List<Employee>
Generics in C# belongs to System.Collections.Generic namespace which contains several generic-based collection classes. Continue reading “Generics in C# .NET With Examples”