Stack.Count : Stack « System.Collections « VB.Net by API






Stack.Count

  


Imports System
Imports System.Collections
Imports System.Collections.Specialized


Public Class MainClass
    
    Shared Sub Main(ByVal args As String())
        Dim letter_stack As New Stack
       
        
        ' Add the letters to the stack.
        For i As Integer = 0 To 10
            Console.WriteLine(i)
            letter_stack.Push(i)
        Next

        ' Remove the letters from the stack.
        Do While letter_stack.Count > 0
            Console.WriteLine( DirectCast(letter_stack.Pop(), Integer) )
        Loop
    End Sub
End Class
  

   
    
  








Related examples in the same category

1.Stack.IsSynchronized
2.Stack.Peek()
3.Stack.Pop()
4.Stack.Push
5.Stack.Synchronized