Difference b/w Array and arraylist :-

Arrays:-

Arrays are strongly typed collection of same datatype and these arrays are fixed length that cannot be changed during runtime.

EX:- string[] arr=new string[2];

arr[0] = "welcome";

arr[1] = "Aspdotnet-suresh";

Arraylists:-

Array lists are not strongly type collection. It will store values of different datatypes or same datatype. Array list size will increase or decrease dynamically it can take any size of values from any data type. These Array lists will be accessible with “System.Collections” namespace.

EX:-ArrayList strarr = new ArrayList();

strarr.Add("welcome"); // Add string values

strarr.Add(10); // Add integer values

strarr.Add(10.05); // Add float values

results matching ""

    No results matching ""