Difference between Array and ArrayList in Java

ArrayArrayList
Arrays are static in nature. They have fixed length, and their size can’t be changed once created.ArrayList is dynamic in nature. Its size can be changed dynamically.
Arrays can hold both primitives and objects.ArrayList can only hold objects.
Arrays can only be iterated through a for loop or for-each loop.ArrayList provides iterators to iterate through its elements.
The size of an array is determined using the length attribute.The size of an ArrayList is determined using the size() method.
Arrays offer constant time performance for both add and get operations.ArrayList also provides constant time performance for add and get operations, provided the addition of an element doesn’t trigger resize.
Arrays do not support generics.ArrayList supports generics, making it type-safe.
Arrays can be multi-dimensional.ArrayLists can’t be multi-dimensional.
Elements are added to an Array using the assignment operator.Elements are added to an ArrayList using the add() method.