> For the complete documentation index, see [llms.txt](https://java-util.k43.ch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://java-util.k43.ch/examples/fifo-lifo-queue.md).

# FIFO/LIFO Queue

### KQueue Class Overview

* Support LIFO (last-in-first-out) and FIFO (first-in-first-out) queue types
* Queues may be explicitly named to be accessible by other threads
* Blocking and non-blocking get() methods

### Example

```java
try (KQueue queue = new KQueue(KQueue.LIFO)) {

   queue.put("A");
   queue.put("B");
   queue.put("C");

   while (!queue.isEmpty()) {
      System.out.println(queue.get());
   }
}
```

### Output

```
C
B
A
```
