Imports System.Collections
public class Test
Private Shared m_Queue As New Queue
public Shared Sub Main
m_Queue.Enqueue("A")
DisplayQueue()
m_Queue.Enqueue("B")
DisplayQueue()
m_Queue.Enqueue("C")
DisplayQueue()
Dim txt As String = DirectCast(m_Queue.Dequeue(), String)
Console.WriteLine(txt)
DisplayQueue()
End Sub
Private Shared Sub DisplayQueue()
For Each str As String In m_Queue.ToArray()
Console.WriteLine(str)
Next str
End Sub
End class
|