Saturday, 23 August 2014

Arrays Vs ArrayLists

                             Arrays
                                 ArrayLists
These are strong type collection and allow to store fixed length
                Array Lists are not strong type collection and size will increase or decrease dynamically

In arrays we can store only one datatype either int, string, char etc…

In arraylist we can store all the datatype values
Arrays belong to System.Array namespace
string[] arr=new string[2];
arr[0] = "welcome";
arr[1] = "Aspdotnet-Sendhilkumar";

Arraylist belongs to System.Collection namespaces
ArrayList strarr = new ArrayList();
strarr.Add("welcome"); // Add string values
strarr.Add(10);   // Add integer values
strarr.Add(10.05); // Add float values

No comments:

Post a Comment