Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.ConcurrentLinkedQueue; public class ConcurrentLinkedQueueOfferExample1 { public static void main(String[] args) throws InterruptedException { ConcurrentLinkedQueue
queue = new ConcurrentLinkedQueue
(); //offer() method insert the element at the tail of queue queue.offer(12); queue.offer(67); queue.offer(45); queue.offer(123); System.out.println("Queue : "+queue); } }
Output