<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">import java.util.*;

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


public class testStackAbstracto {

   public static void main (String [ ] Args) {

      Persona p1 = new  Persona ("Juan", "Nadrie Garcia", 33);
      Persona p2 = new  Persona ("Pedro", "Nunes", 34);
      Persona p3 = new  Persona ("Mauro", "Ruiz perez", 36);
      Persona m1 = new Persona ("Roberto", "Gonzalez GarcÃ­a", 33);
      Persona m2 = new Persona ("Sofia", "Nunes", 34);
      Persona m3 = new Persona ("Karla", "Ruiz Carrillo", 33);

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

      Stack&lt;Persona&gt; s = new Stack&lt;Persona&gt;();

      // agregar
      s.push(p1);
      s.push(p2);
      s.push(p3);
      s.push(m1);
      s.push(m2);
      s.push(m3);

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

   }

}
</pre></body></html>