title: How to print a stack using a string, ended by a sentinel
body: <p>How do I get this to run? I have a stack, I push the String onto the stack, and I print the stack, do I have to also pop the stack to get this to run?   </p>
  
  <pre><code>import java.util.*;
  
  public class Stacks {
      public static void main(String args) {
          Scanner input = new Scanner(System.in);
          String words;
          String DONE = null;
          Stack&lt;String&gt; series = new Stack&lt;String&gt;();
          System.out.println("Enter a series of words or 'DONE' to quit");
          words = input.nextLine();
          series.push(words);
  
          while (!words.equals("DONE")) {
              System.out.println(series);
              System.out.println("Enter a series of words or 'DONE' to quit");
              words = input.nextLine();
  
              if (words.equals("DONE")) {
                  break;
              }
          }
      }
  }
  </code></pre>