Imports System
Imports System.Collections.Generic
Public Class Program
Shared Dim list = New List(Of Integer) From { 1, 2, 3, 4 }
Public Shared Sub push(ByVal n As Integer)
list.Add(n)
End Sub
Public Shared Sub pop()
list.RemoveAt(list.Count - 1)
End Sub
Public Shared Sub Main(ByVal args As String())
push(23)
push(78)
push(99)
For Each n As Integer In list
Console.Write("{0, 3}", n)
Next
pop()
pop()
Console.WriteLine()
For Each n As Integer In list
Console.Write("{0, 3}", n)
Next
End Sub
End Class
' run:
'
' 1 2 3 4 23 78 99
' 1 2 3 4 23
'