Arrays and ArrayList

In Java there are two commonly used containers (collections of values), which store values of a single type. They are called: Arrays and ArrayList. Both of them are members of Java Collection Framework, which is used extensively in programming. They offer similar functionality, however there are some differences between them.

While choosing between using Array and ArrayList class, the second one is usually the first choice, because it is resizable. However ,while adding or removing elements from the beginning of large list is time-consuming operation, because of backing up all content of it into new array, which takes place every time, when these mentioned removing or adding operations occur, nevertheless ArrayList is the most frequently used class of the Collection Framework.