Skip to content

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.

Where the book teaches it

Related terms

FIFOLIFOArrayDequePriorityQueue