1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

Difference b/w List and ArrayList

Discussion in 'C#' started by Carlos, Sep 19, 2009.

  1. Carlos

    Carlos New Member

    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
     
  2. sameer_havakajoka

    sameer_havakajoka New Member

    Try Googleing it na.....I thik both are not the same buddy.
     
  3. SaswatPadhi

    SaswatPadhi ~ Б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. ]]
     
  4. shabbir

    shabbir Administrator Staff Member

    Obviously both cannot be same.
     

Share This Page