Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequeClearExample1 { public static void main(String[] args) { LinkedBlockingDeque
deque = new LinkedBlockingDeque
(); deque.add(23); deque.add(123); deque.add(12); System.out.println("Deque : "+deque); System.out.println("After applying clear() method : "); // clear() method will erase the whole deque deque.clear(); System.out.println("Deque : "+deque); } }
Output