Correct Answer: B
Explanation/Reference:
Explanation:
add
boolean add(E e)
Inserts the specified element into the queue represented by this deque (in other words, at the tail of this
deque) if it is possible to do so immediately without violating capacity restrictions, returning true upon
success and throwing an IllegalStateException if no space is currently available. When using a capacity-
restricted deque, it is generally preferable to use offer.
This method is equivalent to addLast(E).
remove
E remove()
Retrieves and removes the head of the queue represented by this deque (in other words, the first element
of This deque). This method differs from poll only in that it throws an exception if this deque is empty.
This method is equivalent to removeFirst().
Returns:
The head of the queue represented by this deque
Class ArrayDeque