Tutorials
Resources
Forum
Communities
Interview
Jobs
Projects
Offshore Development
Silverlight Tutorials
|
Mentor
|
Code Converter
|
Articles
|
Code Factory
|
Computer Jokes
|
Members
|
Peer Appraisal
|
IT Companies
|
Bookmarks
|
Revenue Sharing
|
Prizes & Awards
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
Abraham Kuriak...
(74)
Murugan
(55)
Murali
(50)
Last 7 Days
Deepika Harida...
(1177)
Pradeep Y
(997)
amarababu nara...
(961)
more...
New Feature:
Community Sites
:
Create your own .NET community website and start earning from Google AdSense !
It's Free !
Generic Collections - Feature of DotNet 2.0
Posted Date: 04 Sep 2008 Resource Type:
Articles
Category:
.NET Framework
Posted By:
VASANTH R
Member Level:
Gold
Rating:
Points
: 7
Suppose if we want to store collection of integer, then we could write code something like,
ArrayList MyList = new ArrayList();
MyList.Add(1);
MyList.Add(2);
It will work good. Suppose if we add like,
MyList.Add("3");
It will compile without error. If we loop through each item and converting it to integer we will got exception thrown.
To avoid this we will go for Generic Type
ArrayList Equivalent Generic Type is List
List MyList = new List();
MyList.Add(1);
MyList.Add(2);
MyList.Add("3"); ---> this will give you complier Error
Responses
No responses found. Be the first to respond and make money from
revenue sharing program
.
Feedbacks
Popular Tags
What are tags ?
Search Tags
Sign In
Generics
.
Feature of dotnet2005
.
Collections
.
Post Feedback
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must
Sign In
to post a response.
Next Resource:
Application Performance - Caching
Previous Resource:
SQL User Defined Functions
Return to Discussion Resource Index
Post New Resource
Category:
.NET Framework
Post resources and
earn money
!
Related Resources
Using Attributes in C#
Default values and Basic conversions of data types in C#
OOPS concenpts in .Net, inheritance, Abstraction and Polymorphism
Don't waste time! Synchronize your ThreadPool.
Threads in c#
dotNet Slackers
BizTalk Adaptors
Web Design
web conferencing services
Contact Us
Privacy Policy
Terms Of Use