Difference b/w List and ArrayList

Contributor
19Sep2009,20:54   #1
Carlos's Avatar
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
Skilled contributor
19Sep2009,21:13   #2
sameer_havakajoka's Avatar
Try Googleing it na.....I thik both are not the same buddy.
~ Б0ЯИ Τ0 С0δЭ ~
20Sep2009,01:26   #3
SaswatPadhi's Avatar
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. ]]
Go4Expert Founder
20Sep2009,08:23   #4
shabbir's Avatar
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.