import java.util.*;

// Documentacion clase Stack: https://docs.oracle.com/javase/7/docs/api/java/util/Stack.html


public class testStackInt {

   public static void main (String [ ] Args) {

      System.out.println ("Pila:");

      Stack<Integer> s = new Stack<Integer>();

      // agregar
      s.push(1);
      s.push(2);
      s.push(3);
      s.push(4);
      s.push(5);
      s.push(6);

      while(!s.empty()) {
         // sacar de la pila
         System.out.println(s.peek());
         s.pop();
      }

   }

}