Kailash Chandra Behera
Difference between Array and ArrayList
By Kailash Chandra Behera in C# on Mar 30 2013
  • Subhashkumar Yadav
    Jan, 2017 16

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

    • 0
  • Kailash Chandra Behera
    Mar, 2013 30

    a) The capacity of an Array is fixed. Where as, ArrayList can increase and decrease size dynamically.
    b) An Array is a collection of similar items. Where as, ArrayList can hold item of different types.
    c) Array is in the System namespace. Where as, ArrayList is in the System.Collections namespace.
    d) An Array can have multiple dimensions. Where as, ArrayList always has exactly one dimension.
    e) We can set the lower bound of an Array. Where as, the lower bound of an ArrayList is always zero.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS