Stack Class represents a simple last-in-first-out (LIFO) non-generic collection of objects. : Stack « Data Structure « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net Tutorial
VB.Net by API
VB.Net » Data Structure » StackScreenshots 
Stack Class represents a simple last-in-first-out (LIFO) non-generic collection of objects.
 

Imports System
Imports System.Collections
Imports Microsoft.VisualBasic

Public Class SamplesStack    

    Public Shared Sub Main()
        Dim myStack As New Stack()
        myStack.Push("Hello")
        myStack.Push("World")
        myStack.Push("!")

        Console.WriteLine(myStack.Count)
        PrintValues(myStack)
    End Sub

    Public Shared Sub PrintValues(myCollection As IEnumerable)
        Dim obj As [Object]
        For Each obj In  myCollection
            Console.Write("    {0}", obj)
        Next obj
        Console.WriteLine()
    End Sub 'PrintValues

End Class

   
  
Related examples in the same category
1.Push Integer into a StackPush Integer into a Stack
2.Simple Demo for Stack: Push, Pop and PeekSimple Demo for Stack: Push, Pop and Peek
3.Stack to ArrayStack to Array
4.Stack Demo: push, pop and peekStack Demo: push, pop and peek
5.Stack<(Of <(T>)>) the ToArray method.
ww__w._j__a_v___a__2_s.___c___om_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.