1.

Distinguish between Array and ArrayList provided by Java.

Answer»
ArrayArrayList
An array is of fixed lengthArrayList is of variable length
Length of the array cannot be changed once createdLength of the array can be changed after creation
It can STORE both primitive types and objectsIt can store only objects, not primitives(it automatically converts primitive TYPE to object)
USING an assignment operator we can store ELEMENTS into an arrayWith the help of add() method elements are stored into an ArrayList
An array can be multi-dimensionalArrayList is always one-dimensional


Discussion

No Comment Found