Back

Difference between Array and ArrayList


The following table lists the differences between Array and ArrayList in C#.

Array ArrayList
Array is strongly typed. This means that an array can store only specific type of items\elements. ArrayList can store any type of items\elements.
Array stores a fixed number of elements. The size of an Array must be specified at the time of initialization. ArrayList grows automatically and you don't need to specify the size.
No need to cast elements of an array while retrieving because it is strongly typed and stores a specific type of items only. The items of ArrayList need to be cast to an appropriate data type while retrieving.
Use static helper class Array to perform different tasks on the array. ArrayList itself includes various utility methods for various tasks.

Visit Array or ArrayList in the C# tutorials section for more information.