title: java input string and stop when 'stop' is entered
body: <p>this is my code and I have a do-while loop which should carry on unless the string "text" entered is "stop". However when I compile the code it doesnt stop and stuck in an infinite loop. Pease help. Thanks.</p>
  
  <pre><code>import java.io.*;
  
  public class input
  {
      public static void main(String[] argv) throws IOException
      {
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));  
          String text = "";  
          do
          {
              System.out.println("Please enter a string: ");
              text = br.readLine(); 
              System.out.println(text);
          }
          while (text != "stop");
      }
  }
  </code></pre>