Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequeOfferLastExample1 { public static void main(String[] args) { int capacity=100; LinkedBlockingDeque
deque = new LinkedBlockingDeque
(capacity); for (int i = 15; i <=20; i++) { // Adding items to the tail of this queue deque.add(i); } System.out.println(deque); System.out.println("After inserting 21 at Last position"); deque.offerLast(21); System.out.println(deque); } }
Output