Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequePollLastExample1 { public static void main(String[] args) { int capacity=100; LinkedBlockingDeque
deque = new LinkedBlockingDeque
(capacity); deque.add("Himanshu"); deque.add("Rahul"); deque.add("Rita"); deque.add("Ramesh"); //retrieves and removes last element of the queue String val = deque.pollLast(); System.out.println("Last element of the deque is : "+val); System.out.println("Elements left in deque: "+deque); } }
Output