the array can not grow in size once it is created. The ArrayList overcomes the issue of a static array in standard Java i.e. On the other hand, ArrayList creates an array of objects where the array can dynamically grow when required. List interface creates a collection of elements that is stored in a sequence and are identified or accessed by their index number.The namespace for List interface is whereas, the namespace for ArrayList is System.Collection.List interface extends the Collection framework whereas, the ArrayList extends AbstractList Class and it implements List interfaces.One of the most important differences between List and ArrayList is that list is an interface and ArrayList is a standard Collection class.Key Differences Between List and ArrayList Because reallocation is costlier than allocating the memory at once. It is better to increase the capacity of array initially instead of reallocating the memory later. Though the capacity of the object of class ArrayList increases automatically when elements are added to the array, still you can manually increase the capacity of the object of ArrayList using the method ensureCapacity(). Hence, Collection framework introduced the ArrayList class to overcome this issue.ĪrrayList has constructors that create the array with its intial capacity. But, it may be the case that you may not know what length of the array you need until the run time. In Java, the standard array has the fixed length, so, you must know the size of the array in advance. The list created using ArrayList class is nothing but the array of objects. The ArrayList class is used to create the dynamic arrays that grow and shrunk whenever required. One of the standard Collection classes is ArrayList which extends AbstractList class and also implements the List interface. It becomes convenient to operate on the sublist instead of a list. You can also get the sublist from the list using a method sublist(). You can set the value of an element in the list using set() method. You can obtain an element from the list using get() method. When one object in a list is incompatible with another object in the list, then ClassCastException is thrown.Null elements are not allowed in the list if you try to insert a null object in the list, NullPointerException is thrown. Methods inside the list may throw an exception like UnsupportedOperationException if the method is unable to modify the list. These methods add an element to the list by their index. The methods added by the List interface are, add(int, E) and addAll(int, Collection). In addition to the methods inherited by Collection framework, List interface also defines some method of its own. A list created using List interface start with a zero based index. You can access an element in the list by its position (index) in the list. List interface has elements that are associated with their index numbers. List interface is implemented by the following standard collection classes like ArrayList, LinkedList, CopyOnWriteArrayList, Vector, Stack. List interface describes the collection of elements that are arranged sequentially. List is an interface which extends the Collection framework.