What is the difference between Array and Arraylist?
In an array, we can have items of the same type only. The size of the array is fixed when compared. To an arraylist is similar to an array, but it doesn't have a fixed size.
An Array is a fixed-size collection of elements, while an ArrayList is a dynamic size collection of elements. You need to specify the size of an Array at the time of declaration, but the size of an ArrayList can grow or shrink dynamically.