Array -> Collection of Homogeneous items.
ArrayList -> Collection of Heterogeneous items.
int [] a ={1,2,3,4,5,6};//It is an array which can acommodate only integers.
coming to arraylist it can hold data of any type->It is a collection(arraylist).
ArrayList al = new ArrayList();
al.add("Dotnet");
al.add(34);
al.add('w');
//It is an arraylist which can hold data of various types(string,char,int,double e.t.c.,);
This is the major difference between an array and arraylist .
Thanks,
Vamsi yadu .K
Venky.Net, if this helps please login to Mark As Answer. | Alert Moderator