Question
Which statement about ArrayDeque as a Stack is the strongest interview answer?
- ArrayDeque as a Stack is mostly a naming style choice and has little effect on runtime or design.
- ArrayDeque as a Stack exists mainly to reduce the number of Java files in a project.
- ArrayDeque is usually the preferred general-purpose stack implementation in modern Java code.
- ArrayDeque as a Stack matters only for frontend frameworks, not for core Java applications.
Hint
Start with the core rule behind ArrayDeque as a Stack.
Answer and rationale
Correct answer: C. ArrayDeque is usually the preferred general-purpose stack implementation in modern Java code.
ArrayDeque is usually the preferred general-purpose stack implementation in modern Java code. This is the base concept interviewers commonly test first.
Track: Java