The Queue works like FIFO system , a first-in, first-out collection of Objects. We can Enqueue (add) items in Queue and we can Dequeue (remove from Queue ) or we can Peek (that is we will get the reference of first item ) item from Queue. Queue accepts null reference as a valid value and allows duplicate elements
Queue.Enqueue(Object) : Add an Item in the Queue
Dim qu As New Queue
Queue qu = new Queue();
Object Queue.Dequeue() : Remove the oldest item from the Queue
The following ASP.NET program add seven days in week to a Queue and bind it to a ListBox control.
Click the following links to see full source code