Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequeClearExample3 { public static void main(String[] args) { LinkedBlockingDeque
deque = new LinkedBlockingDeque
(); deque.add(null); deque.add("bhavika"); System.out.println("Name = "+deque); System.out.println("After clearing the queue :"); // clear() method will erase the whole queue deque.clear(); System.out.println("Name = "+deque); } }
Output