LinkedList is a doubly-linked list implementation of the List and Deque interfaces.
The LinkedList class also offers a lot of useful methods which we can use in our programs. It implements all optional list operations, and permits all elements, including null.
Java provides the LinkedList class as part of the Java Collections Framework. For an overview of the Java Collections Framework, check out my post Overview of the Java Collections Framework.
The following example illustrates the LinkedList class.
Example
Output
The above program showed the use of some of the common methods of the LinkedList class. For a complete list of all the available methods, refer the official docs.
Now since you know how to use the LinkedList class, check out another implementation of the List interface, the ArrayList class in Java.