The LinkedList class defines the following methods for manipulating lists. These are as follows:
void addFirst(E obj): This method inserts an element at the beginning of the list.
void addLast(E obj): This method inserts an element at the end of a list
>E getFirst(): This method is used to retrieve the first element from the list.
E getLast(): This method retrieves the last element from the list.
E removeFirst(): This removes the first element from the list.
E removeLast(): This method removes the last element from the list.
Here, obj specifies the item.
Responses to “What are the methods of the LinkedList class?”