C# Queue Queue()
Description
Queue
initializes a new instance
of the Queue
Syntax
public Queue()
Example
using System;/* www .ja va2 s . co m*/
using System.Collections.Generic;
class Example
{
public static void Main()
{
Queue<string> numbers = new Queue<string>();
numbers.Enqueue("one");
numbers.Enqueue("two");
numbers.Enqueue("three");
numbers.Enqueue("four");
numbers.Enqueue("five");
foreach( string number in numbers )
{
Console.WriteLine(number);
}
}
}
The code above generates the following result.