title: Quit a While Loop if the user types in QUIT
body: <p>I'm writing a spellchecker program that will ask the user for a word and will compare it to a list of words in an array that I have made. </p>
  
  <p>This program needs to be never ending until the user types <code>quit</code>. </p>
  
  <p>So my question is, what would I put <code>while(&gt;&gt; here &lt;&lt;)</code> that would end the program as soon as the user types <code>quit</code> instead of typing another word. The word <code>quit</code> is not in the array. </p>
  
  <p>Here is my code for the while loop so far (not done yet, but it bugs me when I test this and the loop doesn't end on quit, so that's what I need done first).</p>
  
  <pre><code>String quit = "quit"; 
  //this is only declared as "quit" to get the loop to run for testing
  
  while(quit.equals("quit")) {
  
      System.out.println("Please every a word or QUIT to exit");
      String guess = input.nextLine();
  
      for(int i = 0; i &lt; words.length; i++) {
  
          if(guess.equals(words[i])) {
  
              System.out.println("That word is spelled correctly.");
          }   
  
          else {
  
              System.out.println("That word is not spelled correctly.");
              System.out.println("Would you like to add it to the dictionary? (Y/N)");
          }
      }   
  }
  </code></pre>
  
  <p>If you suggest another way of doing it that's not a while loop, although I appreciate it, <strong>it has to be a while loop</strong> for school purposes.</p>