Array vs ArrayList JAVA
Comparison Points 1. Declaration 2. Resizable 3. Performance 4. Traversal 5. Primitives 6. Length 7. Type-Safety 8. Adding elements 9. Multi-dimensional
Declaration Array ArrayList int arr[] = new int[10] ArrayList<Type>arrL=new ArrayList<Type>();
Resizable Array ArrayList Static in size Dynamic in size Fixed length data structure Each ArrayList object has instance variable capacity which indicates the size of the ArrayList. Can not change the length after creating the Array object. As elements are added to an ArrayList its capacity grows automatically.
Performance Array ArrayList resize() N.A. Automatic resize will slow down the performance uses temporary array to copy elements from the old array to new array. ArrayList is internally backed by Array during resizing as it calls the native implemented method. add() or get() Almost same performance , as for ArrayList object these operations run in constant time.
Traversal Array ArrayList Loops Loops + Fail fast iterators
Primitives Array ArrayList can contain both primitive data types as well as objects. can not contains primitive data types (like int , float , double) it can only contains Object
Length Array ArrayList .length .size()
Type Safety Array ArrayList Array is a homogeneous data structure , thus it will contain objects of specific class or primitives of specific data type. Type Safety through Generics
Adding Elements Array ArrayList Assignment operator .add()
Multidimensional Array ArrayList Can be multi dimensional Always single dimensional.

Array vs array list