TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Arraylist vs genericlist List<> in .net 2.0
Raghavendra U
Apr 22, 2013
28
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
Differences between Arraylist and Generic List<>
Arraylist vs Genericlist List<> in .net 2.0:
Arraylist:
It is like Array of objects.
"System.Collections"
is the Namespace for Arraylist. It automatically added to namespace section in aspx.cs page.
We need not to specify object type arraylist going to contain.
In arraylist each item is stored as object. And return value as object.
It needs to box and unbox the elements.
List<T>:
"System.Collections.Generic"
is the Namespace for List. We need to add this.
We need to specify object type which type of elements it contain.
Ex:
List<string> StrObj=new List<string>();
From the above example StrObj will only store string objects.
It doesn't need.
Next Recommended Reading
Opening Visual studio from Run and list of shortcut keys for .NET