Queue Item Count : Queue « Data Structure « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Development
8.Event
9.File Directory
10.Generics
11.GUI
12.Language Basics
13.LINQ
14.Network Remote
15.Security
16.Thread
17.Windows Presentation Foundation
18.Windows System
19.XML
20.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Data Structure » QueueScreenshots 
Queue Item Count
Queue Item Count
 
Imports System
Imports System.Collections
Imports System.Collections.Specialized


Public Class MainClass
    
    Shared Sub Main(ByVal args As String())
        Dim m_Queue As New Queue

        m_Queue.Enqueue("Text")
        m_Queue.Enqueue("Text")
        m_Queue.Enqueue("Text")

        Dim txt As String = DirectCast(m_Queue.Dequeue(), String)
        Console.WriteLine(txt)

        For Each str As String In m_Queue.ToArray()
            Console.WriteLine(str)
        Next str

        Console.WriteLine(m_Queue.Count )
        
    End Sub
End Class
  

           
         
  
Related examples in the same category
1.Queue Demo: enqueue, dequeue and peekQueue Demo: enqueue, dequeue and peek
2.Simple Demo for Queue: Enqueue, Dequeue and PeekSimple Demo for Queue: Enqueue, Dequeue and Peek
3.Creates a queue of strings with default capacity and uses the Enqueue method to queue five strings.
4.The elements of the queue are enumerated, which does not change the state of the queue.
5.The Dequeue method is used to dequeue the first string.
6.The Peek method is used to look at the next item in the queue
7.The ToArray method is used to create an array and copy the queue elements to it
8.the array is passed to the Queue<(Of <(T>)>) constructor that takes IEnumerable<(Of <(T>)>)
9.CopyTo method is used to copy the array elements beginning at the middle of the array.
10.Create a second copy of the queue containing three null elements at the beginning.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.