Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequeOfferExample1 { public static void main(String[] args) { int capacity =100; LinkedBlockingDeque
queue = new LinkedBlockingDeque
(capacity); queue.add(567); queue.add(56); queue.add(5671); queue.add(5167); System.out.println("Queue before using offer() : \n" +queue); queue.offer(5670); System.out.println("Queue after using offer() : \n" +queue); } }
Output