Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequeOfferFirstExample3 { static int i=1; public static void main(String[] args) { int capacity=4; LinkedBlockingDeque
deque = new LinkedBlockingDeque
(capacity); deque.add("Harish"); deque.add("Anjali"); deque.add("Astha"); deque.add("Anushtha"); deque.addFirst("Arpit"); for (String xyz : deque){ System.out.println(i++ +". "+xyz); } } }
Output