Difference b/w List and ArrayList

Carlos's Avatar, Join Date: Dec 2008
Contributor
Hi! can anyone tell me when to use List<emp> and ArrayList. Because both of them have the same capability of adding the object.

Thanks
0
sameer_havakajoka's Avatar
Skilled contributor
Try Googleing it na.....I thik both are not the same buddy.
0
SaswatPadhi's Avatar, Join Date: May 2009
~ Б0ЯИ Τ0 С0δЭ ~
The List class is the generic equivalent of ArrayList class.

You should obviously prefer List (or generics in general), as they promote type safety.
The only reason why you might like to use ArrayList might be if you want to pass it into an existing (1.x) .NET method. [[ Because .NET 1.x did not support generics. ]]
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
Quote:
Originally Posted by sameer_havakajoka View Post
Try Googleing it na.....I thik both are not the same buddy.
Obviously both cannot be same.