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






Stack.Push

  


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.Count
2.Stack.IsSynchronized
3.Stack.Peek()
4.Stack.Pop()
5.Stack.Synchronized