← Quiz: Queue, Deque and PriorityQueue: all 10 questions
Quiz: Queue, Deque and PriorityQueue · Question 10 of 10
Which statement about ArrayDeque is true?
Which statement about ArrayDeque is true?
- A.It keeps elements sorted
- B.It is thread-safe
- C.It does not allow null elements
- D.Adding at the front is O(n)
Answer & explanation
Correct answer: It does not allow null elements
ArrayDeque rejects null because poll and peek use null to mean "empty". Both ends are fast.
Can you get the rest right without peeking?
Take the timed Quiz: Queue, Deque and PriorityQueue quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →