What is the difference between Array and ArrayList?
What is the difference between array,arraylist and list, also give an example?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted May 24, 2012, 4:14 AM
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.
EhteshamPosted May 24, 2012, 2:10 AM
Satyapriya NayakPosted May 24, 2012, 1:47 AM
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