Created
December 16, 2013 22:16
-
-
Save ycaroafonso/7995451 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Module Module1 | |
| Sub Main() | |
| Console.WriteLine("----------------- Exemplo com Stack -----------------") | |
| Dim _stack As New Stack | |
| _stack.Push("item1") | |
| _stack.Push("item2") | |
| _stack.Push("item3") | |
| _stack.Push("item4") | |
| Console.WriteLine("Stack: O primeiro a ser inserido é o ultimo a sair.") | |
| Console.WriteLine("O primeiro da pilha é o -> " & _stack.Peek()) | |
| Console.WriteLine("O primeiro da pilha foi pego e removido -> " & _stack.Pop()) | |
| Console.WriteLine("Agora o primeiro da pilha é -> " & _stack.Peek()) | |
| Console.WriteLine("Atualmente contem os itens:") | |
| For Each item As String In _stack | |
| Console.WriteLine(item) | |
| Next | |
| Console.ReadLine() | |
| End Sub | |
| End Module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment