Glossary: Java Beyond the Basics
Queue
Also written: Stack, stack, queue
A queue is first in, first out (FIFO) and a stack is last in, first out (LIFO). ArrayDeque can act as either: offer, peek and poll for a queue; push and pop for a stack.
Glossary: Java Beyond the Basics
Also written: Stack, stack, queue
A queue is first in, first out (FIFO) and a stack is last in, first out (LIFO). ArrayDeque can act as either: offer, peek and poll for a queue; push and pop for a stack.