Hi Guys
NP53 Generic
I wish to know whether Generic is still used in C# or with the updated versions in C# Generic has become outdated. Because rarely I see Generic in C# programs. Anyone knows please tell.
Thank you
// Examples of various places where generics can be defined:
// Generic Class:
public class MyGenericClass
// Generic Method:
public void MyGenericMethod
// Generic Interface:
public interface MyGenericInterface
// Generic Delegate:
public delegate void MyGenericDelegate
Posted Oct 14, 2007, 7:14 PM
Thank you, Alan
AlanPosted Oct 14, 2007, 7:04 PM
Generics were in fact introduced into C# in v2.0 and are very much part of C# programming today. However, it's probably fair to say that more programmers use the generic classes in the .NET framework (such as List, Dictionary etc) than write their own.
The reason why you might not have seen them much, Maha, is that they're not regarded as a beginner's topic and so lessons in basic C# tend therefore to avoid them.