Implementation of the Queue can base on FIFO, priorities and LIFO - that is what official documentation says.
When a programmer first sees "Queue" he automatically thinks "it must be FIFO order" (or eventually prioritized order). But as documentation says there must be possibility to use Queue interface for LIFO ordering. Let me explain you how it can be done.
// FIFO queue usage
Queue<Integer> queue = new LinkedList<>();
queue.add(1);
queue.add(2);
queue.remove(); // returns 1
queue.remove(); // returns 2
// LIFO queue usage
Queue<Integer> queue = Collections.asLifoQueue(new ArrayDeque<>());
queue.add(1);
queue.add(2);
queue.remove(); // returns 2
queue.remove(); // returns 1
As you can see depending on the implementation, Queue interface can be used also as a LIFO.