what are generics? Without generics what are the
disadvantages in 1.1?
Answer Posted / 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 |
Post New Answer View All Answers
Explain unit test done by tester on development team?
What is basic authentication in web api?
What is managed extensibility framework?
Where are the routing rules defined in an asp.net mvc application?
i just want to write an exam regarding .net?plz give me information about taking a test?where to pay 4 d exam,exam centre?
Explain JSON Binding?
Is dapper better than entity framework?
Explain linq to entities? : Entity framework
What is entity framework used for?
What is the difference between viewbag and viewdata in mvc?
Can you explain renderbody and renderpage in mvc?
Explain RenderBody and RenderPage in ASP.Net MVC?
What are the possible razor view extensions?
What is entitytype? : Entity framework
What are non action methods in mvc?