Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.ConcurrentLinkedQueue; public class ConcurrentLinkedQueueRemoveExample1 { public static void main(String[] args) { ConcurrentLinkedQueue
queue = new ConcurrentLinkedQueue
(); queue.add(12); queue.add(98); queue.add(122); queue.add(102); queue.add(112); System.out.println("Elements in queue : "+queue); //remove() method will remove the specified element from the queue queue.remove(122); queue.remove(102); System.out.println("Remaining elements in queue : "+queue); } }
Output