Arraylist vs genericlist List<> in .net 2.0

Arraylist vs Genericlist List<> in .net 2.0:

Arraylist:
  1. It is like Array of objects.
  2. "System.Collections" is the Namespace for Arraylist. It automatically added to namespace section in aspx.cs page.
  3. We need not to specify object type arraylist going to contain.
  4. In arraylist each item is stored as object. And return value as object.
  5. It needs to box and unbox the elements.
List<T>:

  1. "System.Collections.Generic" is the Namespace for List. We need to add this.
  2. We need to specify object type which type of elements it contain. 
  3. Ex: List<string> StrObj=new List<string>();
  4. From the above example StrObj will only store string objects.
  5. It doesn't need.
Ebook Download
View all
Learn
View all