Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequeAddFirstExample3 { static int i=1; public static void main(String[] args) { int capacity=4; LinkedBlockingDeque
deque = new LinkedBlockingDeque
(capacity); deque.add("Disha"); deque.add("Tanmay"); deque.add("Prachi"); deque.add("Garvit"); deque.addFirst("Dia"); for (String xyz : deque){ System.out.println(i++ +". "+xyz); } } }
Output