Home > Software > .NET > Dot-Net
Interview Questions   Tutorials   Discussions   

Dot-Net - What are Generics? Where do we use them?

asked mar October 4, 2014 06:09 AM  

What are Generics? Where do we use them?


1 Answers

answered By siddhant   0  

Generics allow you to delay the specification of the data type of programming elements in a class or a method, until it is actually used in the program. In other words, generics allow you to write a class or method that can work with any data type.

Using generics is a technique that enriches your programs in the following ways:

  • It helps you to maximize code reuse, type safety, and performance.
  • You can create generic collection classes. The .NET Framework class library contains several new generic collection classes in the System.Collections.Generic namespace. You may use these generic collection classes instead of the collection classes in the System.Collections namespace.
  • You can create your own generic interfaces, classes, methods, events and delegates.
   add comment

Your answer

Join with account you already have



 Write A Tutorials
Online-Classroom Classes

  1 person following this question

  1 person following this tag

  Question tags

Asked 1 year and 1 month ago ago
Number of Views -124
Number of Answers -1
Last updated
2 years and 18 days ago ago

Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!