The clear(E element) method of LinkedList removes all the elements from this list. The linked list becomes empty as a result of this call. Syntax…
Posts published in “Java”
The contains(E element) method of LinkedList checks if the LinkedList contains the specified element or not. It returns true if the linked list contains the…
The element() method of LinkedList retrieves but does not remove the first element of this linked list. It throws NoSuchElementException if the linked list is…
The get(int index) method of LinkedList returns the element at the specified index in this list. It throws IndexOutOfBoundsException if the specified index is out…
The getFirst() method of LinkedList returns the first element of this linked list. It throws NoSuchElementException if this linked list is empty. Syntax Parameters it…
The getLast() method of LinkedList returns the last element of this linked list. It throws NoSuchElementException if this linked list is empty. Syntax Parameters it…
The indexOf(E element) method of LinkedList returns the first occurrence of the specified element in this linked list. Syntax Parameter e is the element to…
The lastIndexOf(E element) method of LinkedList returns the last occurrence of the specified element in this linked list. Syntax Parameter e is the element to…
The offer(E element) method of LinkedList appends the specified element at the end of this linked list. It returns true on the successful insertion of…
The offerFirst(E element) method of LinkedList appends the specified element at the start of this linked list. It returns true on the successful insertion of…