Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequePeekExample3{ public static void main(String[] args) { int capacity =100; LinkedBlockingDeque
deque = new LinkedBlockingDeque
(capacity); deque.add("Harsh"); deque.add("Arun"); deque.add("Vaibhav"); deque.add(null); deque.clear(); String val = deque.peek(); System.out.println("Head of deque is : "+val); } }
Output