VB.Net program to check the specified item is exits in the Queue collection or not
'VB.Net program to check the specified item exists
'in the Queue collection or not.
Imports System
Imports System.Collections
Module Module1
Sub Main()
Dim queue As New Queue(5)
queue.Enqueue("India")
queue.Enqueue("USA")
queue.Enqueue("UK")
queue.Enqueue("CHINA")
If (queue.Contains("India")) Then
Console.WriteLine("Item exists in queue")
Else
Console.WriteLine("Item does not exist in queue")
End If
End Sub
End Module
Item exists in queue
Press any key to continue . . .
Table of Contents