Buy Questpond's video subscriptions on
huge discount
.
Online: 4101
Home
Articles
Interviews
Forums
For Beginners
Popular Questions
ITIL Career Advice
PMP Career Advice
Career Advices
Codes
Videos
ASP.NET
ASP.NET MVC
Android Intel XDK
Sql Server
AngularJS
Bootstrap
Backbone.JS
MongoDB
LESS (CSS)
jQuery
WPF
WWF
SSIS
LightSwitch
Tutorials
News
ASP.NET MVC
|
Be Interview Ready
|
Top Performers
|
DNF MVP
|
Top Posts
|
Winners
|
Subscribe
|
Catalogs
Welcome Guest !
Register
Login
Home
>
Forums
>
ASP.NET
>
Loading ...
define generics with example and advantages
Posted by
Sheeba
under
ASP.NET
on 11/3/2010 |
Points: 10
| Views : 6549 | Status :
[Member]
| Replies : 1
Write New Post
|
Search Forums
|
Resolved Posts
|
Un Answered Posts
|
Forums Home
Hi
define generics with example and advantages
Reply
|
Reply with Attachment
Alert Moderator
Responses
Posted by:
Lalji_mer
on: 11/3/2010
[Member]
Bronze
|
Points: 25
0
about generics you will get here
http://aspalliance.com/1100
http://msdn.microsoft.com/en-us/library/ms379564%28VS.80%29.aspx
Generics main benefit is eliminating boxing and unboxing that is true, there are also other benefits like type safety, by using generics you eliminate type ambiguitiy.
1. Generics provide type safety without the overhead of multiple implementations. Ex. We can create a linked list of string. LinkedListlinkList=new LinkedList(); There is no need to inherit from a base type and override members.The linked list is ready for immediate use.
2. There is no need to write code to test for the correct data type because it is enforced at compile time. The need for type casting and the possibility of run-time errors are reduced.
3. Generic collection types generally perform better for storing and manipulating value types because there is no need to box the value types
. 4. Generic delegates enable type-safe callbacks without the need to create multiple delegate classes.
LP MER
Sheeba
, if this helps please
login
to
Mark As Answer
. |
Alert Moderator
Login to post response
Latest Posts
How to get the exact property name while getting error
(0)
PDB file is not showing Line Number in dot net application hosted on server
(0)
Both Strings morethan 5 letters in length end of the words one vowel and one consonent is different
(0)
how to check Any adjacent letters transposed between two strings(ex: JOHN, JHON)
(1)
can't receive data after success login ?
(1)
Implement Multi-Tenant in Azure Logic Apps
(0)
Why ASP.Net Core 7.0 Web API showing as Connection refused?
(0)
Iterating over columns of dataframe and print as rows in Python Django
(0)
More ...