Java Deque MCQs with answers
80 questions tagged Java Deque, each with the correct answer and an explanation. Page 3 of 4.
- Which of these Deque implementations supports blocking operations?
- Which method inserts at the tail and blocks if necessary?
- Which method is used to insert an element at the front in a blocking deque?
- Which Deque method inserts an element and returns false if capacity is full?
- In which package is the Deque interface found?
- Which method removes and returns the first element, throwing an exception if empty?
- Which method is NOT part of the Deque interface?
- Which method removes and returns the first element in Deque?
- Which Deque method behaves like a queue’s poll() method?
- Which of these is a thread-safe implementation of Deque?
- What is the default capacity of an ArrayDeque?
- Which Deque method throws NoSuchElementException if the Deque is empty?
- Which of the following operations is not supported directly by Deque?
- Which of the following is true for ArrayDeque?
- What will `peekLast()` return on an empty Deque?
- Which method in Deque is used to remove the last element and return it?
- Which Deque method acts similarly to `Stack.pop()`?
- Which method in Deque returns but does not remove the first element?
- Which Deque method is used to simulate queue behavior by adding to the rear?
- Which Deque method throws an exception if the element cannot be added at the front?