2
Answers

NP53 Generic

Maha

Maha

17y
2.2k
1

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<T> {}

 

                    // Generic Method:

                    public void MyGenericMethod<T>(T type) {}

 

                    // Generic Interface:

                    public interface MyGenericInterface<T> {}

 

                    // Generic Delegate:

                  public delegate void MyGenericDelegate<T>(T type);

Answers (2)