Java LinkedList class uses doubly linked list to store the elements. It provides a linked-list data structure. It inherits the AbstractList class and implements List and Deque interfaces.
In case of doubly linked list, we can add or remove elements from both side.
public class LinkedList
LinkedList()It is used to construct an empty list.
LinkedList(Collection c) It is used to construct a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
void add(int index, Object element) It is used to insert the specified element at the specified position index in a list.
void addFirst(Object o) It is used to insert the given element at the beginning of a list.
void addLast(Object o) It is used to append the given element to the end of a list.
int size() It is used to return the number of elements in a list
boolean add(Object o) It is used to append the specified element to the end of a list
boolean contains(Object o) It is used to return true if the list contains a specified element.
boolean remove(Object o It is used to remove the first occurence of the specified element in a list.