Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequeAddExample1 { public static void main(String[] args) { int j =1; int capacity=10; LinkedBlockingDeque
deque = new LinkedBlockingDeque
(capacity); for (int i = 1; i <=5; i++) { // Adding items to the tail of this queue deque.add(i); System.out.println("After adding "+ j++ +" to the deque :"); System.out.println(deque); } } }
Output