ConcurrentLinkedDeque remove() method in Java with Examples Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report The java.util.concurrent.ConcurrentLinkedDeque.remove() is an in-built function in Java which is used to remove an element from this deque.Syntax: public E remove() or public boolean remove(Object o) Parameters: The first overload of this method does not accepts any parameter. However the second overload of this method accepts an element o as parameter which is to be removed from this ConcurrentLinkedDeque.Return Value: This method returns the element removed if no particular element is specified as parameter. if an element is specified as parameter, then it returns a boolean value stating whether this element is removed or not.Exception: The first overload of this function throws a NoSuchElementException if this deque is empty. Whereas the second overload throws NullPointerException if the specified element is null.Below programs illustrate the ConcurrentLinkedDeque.remove() method:Example: 1 Java // Java Program to demonstrate // ConcurrentLinkedDeque remove() method import java.util.concurrent.*; class ConcurrentLinkedDequeDemo { public static void main(String[] args) { // Create a ConcurrentLinkedDeque // using ConcurrentLinkedDeque() constructor ConcurrentLinkedDeque<Integer> cld = new ConcurrentLinkedDeque<Integer>(); cld.add(40); cld.add(50); cld.add(60); cld.add(70); cld.add(80); // Displaying the existing LinkedDeque System.out.println("Existing ConcurrentLinkedDeque: " + cld); // remove method removes the first element of queue // using remove() method System.out.println("Element removed: " + cld.remove()); // Displaying the existing LinkedDeque System.out.println("Modified ConcurrentLinkedDeque: " + cld); } } Output: Existing ConcurrentLinkedDeque: [40, 50, 60, 70, 80] Element removed: 40 Modified ConcurrentLinkedDeque: [50, 60, 70, 80] Example: 2 Java // Java Program to demonstrate // ConcurrentLinkedDeque remove(Object o) method import java.util.concurrent.*; class ConcurrentLinkedDequeDemo { public static void main(String[] args) { ConcurrentLinkedDeque<String> cld = new ConcurrentLinkedDeque<String>(); cld.add("GFG"); cld.add("Gfg"); cld.add("GeeksforGeeks"); cld.add("Geeks"); // Displaying the existing LinkedDeque System.out.println("Elements in" + "the LinkedDeque: " + cld); // Remove "Gfg" using remove(Object) System.out.println("Gfg removed: " + cld.remove("Gfg")); // Displaying the elements System.out.println("Elements in" + "the LinkedDeque: " + cld); } } Output: Elements inthe LinkedDeque: [GFG, Gfg, GeeksforGeeks, Geeks] Gfg removed: true Elements inthe LinkedDeque: [GFG, GeeksforGeeks, Geeks] Comment More infoAdvertise with us Next Article ConcurrentLinkedDeque removeLast() method in Java P ProgrammerAnvesh Follow Improve Article Tags : Java Java-Collections Java - util package Java-Functions Java-ConcurrentLinkedDeque +1 More Practice Tags : JavaJava-Collections Similar Reads ConcurrentLinkedDeque pop() method in Java with Examples The Java.util.ConcurrentLinkedDeque.pop() method in Java is used to pop an element from the ConcurrentLinkedDeque. The element is popped from the top of the ConcurrentLinkedDeque and is removed from the same.Syntax: ConcurrentLinkedDeque.pop() Parameters: The method does not take any parameters.Retu 2 min read ConcurrentLinkedDeque poll() method in Java with Example The poll() method of ConcurrentLinkedDeque returns the front element in the Deque container and deletes it. It returns null if the container is empty. Syntax: public E poll() Parameters: This method does not accept any parameters. Returns: This method returns front element of the Deque container if 2 min read ConcurrentLinkedDeque removeFirst() method in Java The ConcurrentLinkedDeque.removeFirst() is an in-built function in Java which removes the first element from the deque container. The function throws a NoSuchElementException if this deque is empty. Syntax: Conn_Linked_Deque.removeFirst() Parameters: The function does not accepts any parameter. Retu 2 min read BlockingDeque remove() method in Java with Examples The remove() method of BlockingDeque removes the head of the Deque container. The method throws a NoSuchElementException if the Deque container is empty. If an element in passed in the parameter, it removes the given element if present in the Deque. Syntax: public E remove() or boolean remove(elemen 2 min read ConcurrentLinkedDeque removeLast() method in Java The ConcurrentLinkedDeque.removeLast() is an in-built function in Java which removes the last element in the deque. The function throws a NoSuchElementException if this deque is empty. Syntax: Conn_Linked_Deque.removeLast() Parameters: The function does not accepts any parameter. Return Values: The 2 min read ConcurrentLinkedQueue remove() method in Java The remove(Object o) method of ConcurrentLinkedQueue is used to remove a single instance of the specified element from this ConcurrentLinkedQueue, if it is present. This method removes an element e such that o.equals(e) if this ConcurrentLinkedQueue contains one or more such elements. Remove() metho 2 min read Like