StackDemo.java.html

  1  public class StackDemo
  2  {
  3     public static void main(String[] args)
  4     {
  5        LinkedListStack s = new LinkedListStack();
  6        s.push("Tom");
  7        s.push("Diana");
  8        s.push("Harry");
  9        while (!s.empty())
 10        {
 11           System.out.println(s.pop());
 12        }
 13     }
 14  }