An ArrayList is backed up by array internally. There are many
usability advantages of using an ArrayList over an array in Java.
Array has a fixed length at the time of creation. Once it is created
we cannot change its length.
ArrayList is dynamic in size. Once it reaches a threshold, it
automatically allocates a new array and copies contents of old array
to new array.
Also ArrayList provides support of Generics. But Array does not
support Generics.
E.g. If we store an Integer object in a String array at Runtime it will
throw ArrayStoreException. Whereas, if we use ArrayList then as
compile time we will get the error. This helps in preventing errors
from happening at runtime.
If we know the size in advance and do not need re-sizing the
collection then Array should be used in place of an ArrayList