title: Why does Eclipse allow string comparisons with ==?
body: <p>I understand and know why you typically have to use == to compare strings in java, but for some reason I am able to do it in Eclipse. My code is
  Code:</p>
  
  <pre><code>public class Test{
      public static void main(String [] args){
          String str1 = "string";
          if(str1 == "string"){
              System.out.println("wtf");
          }
      }
  }
  </code></pre>
  
  <p>Why does this print "wtf" yet using javac from command line does not?</p>