Online Java Compiler By
JavaTpoint.com
import java.util.concurrent.LinkedBlockingDeque; public class LinkedBlockingDequeContainsExample1 { public static void main(String[] args) { int capacity=10; LinkedBlockingDeque
deque = new LinkedBlockingDeque
(capacity); deque.add("Himanshu"); deque.add("Rahul"); deque.add("Rita"); deque.add("Ramesh"); for (String xyz : deque){ System.out.println(xyz); } /*contains() method will return a boolean value if the specified object is present in the deque*/ System.out.println("queue.contains( Himanshu) will return "+deque.contains("Himanshu")); } }
Output