LinkedList contains a collection of nodes and implements a linear data structure. It is a doubly-linked list since it contains a link to the previous node as well as the next successive node. It extends the AbstractList class and implements the List and Deque interfaces. Java LinkedList is a doubly-linked list that can store any type of data.
The main difference between array and ArrayList is that the array is static(we cannot add or remove elements) while ArrayList is dynamic(we can add, remove or modify elements) LinkedList It extends the Abstract class and implements the Java List interface. When to use ArrayList and LinkedList ArrayListĪrrayList in Java is the most commonly used data structure for creating a dynamic size array.