Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what are generics? Without generics what are the
disadvantages in 1.1?

Answers were Sorted based on User's Feedback



what are generics? Without generics what are the disadvantages in 1.1?..

Answer / purushottam.ambati@gmail.

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.

Is This Answer Correct ?    18 Yes 1 No

what are generics? Without generics what are the disadvantages in 1.1?..

Answer / lakshmi

They are tad similar to C++ templates. With .net 1.0,
creating a flexible class or method that should use classes
that are known at compile time must be based on the object
class. With the object class, theres no type safety during
compile time. casting is necessary. Also, using the object
class for value types has a performance impact. .Net 2.0
supports generics, with generics the object class is no
longer necessary in such scenarios. Generic classes make
use of generic types that are replaced with specific types
as needed. This allows for typesafety. The
system.collections.Generic namespace gives you access to
generic versions of the stack, dictionary,
sorted dictionary, list and queue classes.
Advantages: Binary code reuse, performance, easy of
reading, typesafety.

Is This Answer Correct ?    8 Yes 0 No

what are generics? Without generics what are the disadvantages in 1.1?..

Answer / rama krishna

Generics are place holders for the actuval data types.
Generics are defenied with left and right angular brackets.
once we develop,test and deploy it may be used with feature
data types also.

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More Dot Net Framework Interview Questions

how to face first interview in .NET?

2 Answers   HCL, Xponent,


Explain covariance and contra-variance in .net framework 4.0. Give an example for each.

0 Answers  


What is web api‘s in asp.net mvc 4 ?

0 Answers  


What are the components of the .net framework.

0 Answers  


Can u tell me differences which are introduced in .Net 1.1 and 2.0 and 3.0 and also in 3.5 ? by detailed?

1 Answers   ABC,


what are partial classes?

12 Answers   Digimaker, HP, N Tech, TCS,


Features in .net framework 1.1 ?

1 Answers   Digital GlobalSoft,


What is GC (Garbage Collection) and how it works

1 Answers  


What are Resource Files ? How are they used in .NET

1 Answers  


What are the possible razor view extensions?

0 Answers  


Difference between ASP.NET MVC and ASP.NET WebForms?

0 Answers  


How do I change the permission set for a code group

1 Answers   4Cplus,


Categories