What are Generics?

Answer Posted / rt

Generics was a new addition in .NET 2.0
With generics we can create reusable classes. It promotes code reusability.
With generics we create classes with placeholders(<T>), and while creating object of that class we declare a value for that placeholder(int,double,etc) and from then on that object is bind to that type.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is ienumerable used?

502


Can an abstract class inherit from another abstract class c#?

550


What is data annotation in c#?

509


In .Net, what is an assembly? Also explain the type of assembly.

520


How do I do a case-insensitive string comparison?

521






How long has c# been around?

567


Can properties be overloaded in c#?

554


What is the default value of string in c#?

559


What is a web service in c#?

587


What is difference between throw and throws in c#?

454


What is console based application?

478


how background thread access to ui control?

593


What is static classes?

490


Explain the OOPS concept in C#?

583


Do while loops yes or no c#?

526