How generics is used in .NET 1.1 and .NET 2.0
Posted on February 14th , 2012 by Admin
|
|
The term Generics is a concept introduced in .NET 2.0 and these are just like templates in C++. Using generics we can create classes,methods,events, delegates which work with any type (like int,string,myclass etc). In .NET 2.0, System.Collections.Generic namesapce was introduced and it contains classes/interfaces related to generics. Advantages are Performance, Code Reuse, Type Safety.
we can create generic classes (which work with any type)in .NET 1.1 by |
| using System.Object class. But, it requires type casting, boxing and unboxing operations internally. these operations are very expensive. so performace of application will degrade. |
|
|