Delta

generic stack

May 9th, 2011
293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace blah
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             Stack<String> pilha = new Stack<String>();
  11.             pilha.Push("Entrou primeiro na pilha");
  12.             pilha.Push("Entrou por segundo na pilha");
  13.             pilha.Push("Entrou por ultimo na pilha");
  14.  
  15.             Console.Write("{0}\r\n{1}\r\n{2}", pilha.Pop(), pilha.Pop(), pilha.Pop());
  16.  
  17.             Console.ReadKey();
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment