Difference between array and arraylist.

Answer Posted / mohammad fazulullah

Array is the object and it stores the object of same type

Eg : Its stores complete integer types or string types

int[] IntArray = new int[3];
string[] StringArray = new StringArray[2];

Arraylist is the collection in which we can store the
objects of any data type.

Eg : Arraylist Arr = new Arraylist()
Arr.Add(13); // Integer Type
Arr.Add(10); // String Type

2 . Arrays has the Fixed Lenght where as the Arraylist
varies the leghth as the objects Added.

Is This Answer Correct ?    196 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a conditional statement explain with example?

735


Can we pass null as argument in java?

675


Can an interface have a constructor?

697


Why char array is preferred over string for storing password?

806


Why parameters should be passed by reference?

676






Is char * a string?

724


What are decalarations?

822


Explain about the performance aspects of core java?

743


What are implicit objects in java?

726


What is protected in java?

715


What is thread life cycle in java?

785


How use .contains in java?

849


Can inner class extend any class?

787


What is a line break example?

734


What is wrapper class html?

688