Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequePollExample1 { public static void main(String[] args) { LinkedBlockingDeque
deque = new LinkedBlockingDeque
(); deque.add("Rahul"); deque.add("Sagar"); deque.add("Tarun"); deque.add("Vaibhav"); System.out.println("Deque before using poll() method : " +deque +"\n"); String val = deque.poll(); System.out.println("Head of Deque is: "+val +"\n"); System.out.println("Deque after using poll() method : " +deque); } }
Output