Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequePeekLastExample3 { public static void main(String[] args) { int capacity =20; LinkedBlockingDeque
deque = new LinkedBlockingDeque
(capacity); deque.add("Employee1"); deque.add("Employee2"); deque.add("Employee3"); deque.add("Employee4"); deque.clear(); System.out.println("Last element of deque : "+deque.peekLast()); System.out.println("Deque after peekLast() : "+deque +"\n" ); } }
Output