title: How should I declare strings?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1881922/questions-about-javas-string-pool">Questions about Java’s String pool</a>  </p>
  </blockquote>
  
  
  
  <p>What's the difference between the two ways of declaring strings in Java?    </p>
  
  <pre><code>String se1 = "java";
  String se2 = "java";
  System.out.println(se1 == se2); // output true
  
  String str1 = new String("OKAY");
  String str2 = new String("OKAY");
  System.out.println(str1 == str2); // output false
  </code></pre>