how to check queue is empty in java code example Example: queue.isempty java while (!QUEUE.isEmpty()) { QUEUE.remove(); }