Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; import java.util.concurrent.TimeUnit; public class LinkedBlockingDequePollExample3{ public static void main(String[] args) throws InterruptedException { LinkedBlockingDeque
deque = new LinkedBlockingDeque
(); deque.add("Dwayne"); deque.add("Adam"); deque.add("Mark"); deque.add("Robret"); deque.add("Winston"); deque.add("Peter"); String val= deque.poll(123467,TimeUnit.MILLISECONDS); System.out.println("First element of Deque is: " +val ); System.out.println("Deque after using poll() method : " +deque); } }
Output