Junior
From PDF
Collections
C# Collections
What is a Queue<T> in C#?
A Queue<T> is a generic collection in C# that stores elements in a First-In, First-Out
(FIFO) order.
- The first item added is the first to be removed.
- It is part of the System.Collections.Generic namespace.
Use case:
Modeling real-world queues — e.g., print jobs, task scheduling, or customer service
systems.
Example:
Queue<string> orders = new Queue<string>();
orders.Enqueue("Order1");
orders.Enqueue("Order2");
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png