java - where to use ArrayList and where to use simple array specially for integer -


can please explain in situation supposed use arraylist instead of simple array , diffrence between these 2 , how intialise arraylist.i new java use example if possible

whenever don't know size created, can use arraylist..

if want speed access, can use array. (indexing in array faster arraylist)..

and , arraylist reduces complexity of coding...

arraylist can initialized creating object arraylist class

arraylist al = new arraylist();

al.add("string"); || al.add(number); can used add values arraylist..


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -