What are generics? why it is used?
architecture of ASP.NET?
Answers were Sorted based on User's Feedback
Answer / pavithra d
Generics are new in .NET 2.0.It is used to define a type
while leaving some details unspecified.Generics are the
replacement of "Objects" in .NET1.1
Generics reduces the run-time error and increases the
performance.
| Is This Answer Correct ? | 15 Yes | 4 No |
Answer / krishna rathi
Generica provide type parameters T for class , interfaces,
delagates or methods.
By using generic type parameter T their
is less need of boxing / un boxing in client code.
Example : public class Genericlist <T>{
}
| Is This Answer Correct ? | 10 Yes | 3 No |
Answer / jyoti
Generics provide the solution to a limitation in earlier
versions of the common language runtime and the C# language
in which generalization is accomplished by casting types to
and from the universal base type Object. By creating a
generic class, you can create a collection that is type-
safe at compile-time.increases the
performance.
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / jithu
Generics are an extremely useful feature that allows you to
write type safe and efficient collection- and pattern-based
code.
Generics allow you to create type-safe code without knowing
the final type you will be working with. In many instances,
you want the types to have certain characteristics, in
which case you place constraints on the type
| Is This Answer Correct ? | 4 Yes | 2 No |
Answer / tak
Generics is a new feature added and shiped with .NET 2.0
and above that solves the type safe related issues. So
using generics reduces the extra work/time between boxing
and unboxing as a result boost performance.Using
Generics ,we will be safe a run time error which will
occure due to type casting problem that we may not see at
compile time...regardless of knowing the type at design
time..
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / me
Generics are the type safe data structures that was introduced in .Net 2.0.Following are the benefits of it-
Better Performance: They are better in performance as boxing/unboxing is not required.thus reducing execution cost and time.
Type safety : it gives error at compile time if a data type mismatch is found.
Code reusablity : Same code is reused for various data tyoe like int,string etc.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / sachin
Generic is special kind of data type.
which can be resolve at a runtime.
means u can have function add(<T>val,<T>val)
where u can pass any type datatype.
| Is This Answer Correct ? | 1 Yes | 1 No |
What ?ll u do in early and late binding ?
Difference between abstract factory pattern and factory method pattern in .NET with example.
3 Answers ACS, IBM, Keane India Ltd,
what is the differance between native code & managed code?
what is Theme in Asp.net 2.0
Define repository pattern in asp.net mvc? : asp.net mvc
What are navigation controls? How many navigation controls are there in ASP.NET 4.0?
Mention few asp.net validators.
What do you mean by marshalbyref?
Can you dynamically assign a Master Page?
If I have more than one version of one assemblies, then how will I use old version (how/where to specify version number?) In my application?
True or False: A Web service can only be written in .NET?
What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)