Mega Code Archive

 
Categories / VB.Net / Data Structure
 

The Peek method is used to look at the next item in the queue

Imports System Imports System.Collections.Generic Module Example     Sub Main         Dim numbers As New Queue(Of String)         numbers.Enqueue("one")         numbers.Enqueue("two")         numbers.Enqueue("three")         numbers.Enqueue("four")         numbers.Enqueue("five")         Console.WriteLine("Peek at next item to dequeue: {0}", numbers.Peek())         End Sub End Module