Question 11
Back to Exercise
Why does the JDK documentation recommend ArrayDeque over java.util.Stack for a stack?
- A Stack cannot store objects
- B Stack is synchronized and extends Vector, so it is slower and exposes index-based methods Correct
- C ArrayDeque allows null elements
- D Stack has no pop method
Correct Answer: Option B
ArrayDeque is an unsynchronized circular array (and it does not allow null elements).
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!