Forum guidelines
AuthorQuestion
What is the difference between Array and ArrayList?
Posted By Richa Garg on 24 May 2012
What is the difference between array,arraylist and list, also give an example?

AuthorReply
Re: What is the difference between Array and ArrayList?
Posted By Satyapriya Nayak on 24 May 2012  
Hi Richa,

Array is the collection of values of the same data type
the variables in an array is called array elements
Array is a reference type data type
The array structure in System's Memory

Array list is a class .
when you want to access the elements of an array through its index value location in an array,use an ArrayList.
The use of the arraylist is an alternative to the use of the array.
The Methods Of ArrayList class are
1)Add
2)Remove
3)Clear
4)Insert
5)TrimToSize
6)Sort
7)Reverse

Please refer the below links

http://www.c-sharpcorner.com/uploadfile/puranindia/arrays-in-C-Sharp-language/default.aspx

http://www.c-sharpcorner.com/UploadFile/puranindia/C-Sharp-arraylist/



Thanks

If this post helps you mark it as answer
Thanks

Re: What is the difference between Array and ArrayList?
Posted By Ehtesham on 24 May 2012  
another difference between array list and array is arraylist can dynamically increase or decrease its size were as array size is constant

If my post is useful then mark it as "Accepted Answer"
Re: What is the difference between Array and ArrayList?
Posted By Senthilkumar on 24 May 2012  
Hi,

Simply you can say,

Array is data type oriented. It should be int or float or string or object, etc., but the arraylist is stores everything is type oriented.

The array size has to be defined and arraylist can grow dynamically. But it will take atleast 32 initially.

The Array is type safe and arraylist needs type conversion and leads runtime error.

The Arraylist belongs to system.collection and array belongs to system.Array namespace.



If this post is useful then mark it as "Accepted Answer"

SPONSORED BY

Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.