Short answer
Use ArrayDeque for both stacks and queues: it's array-backed, faster than LinkedList, and unlike the legacy Stack class (which extends Vector and is synchronized and slow) it isn't burdened by Vector's design.
Explanation
Prefer the Deque methods (push/pop/offer/poll) which return/insert without throwing on empty, over add/remove which throw. For producer-consumer concurrency reach for BlockingQueue implementations (ArrayBlockingQueue, LinkedBlockingQueue), and for priority ordering use PriorityQueue, remembering it isn't thread-safe and iteration order isn't sorted.
Common mistakes
- Using java.util.Stack in new code.
- Using LinkedList as a queue where ArrayDeque is faster.