What is Array List in Java?
Herein, what is Array and ArrayList in Java?
Array vs ArrayList in Java. Array is a fixed length data structure whereas ArrayList is a variable length Collection class. We cannot change length of array once created in Java but ArrayList can be changed. Since Java 5, primitives are automatically converted in objects which is known as auto-boxing.
Keeping this in view, what is array in Java?
Java array is an object which contains elements of a similar data type. Array in Java is index-based, the first element of the array is stored at the 0th index, 2nd element is stored on 1st index and so on. Unlike C/C++, we can get the length of the array using the length member.
List is a child interface of Collection. It is an ordered collection of objects in which duplicate values can be stored. Since List preserves the insertion order, it allows positional access and insertion of elements. List Interface is implemented by the classes of ArrayList, LinkedList, Vector and Stack.