9 Replies Latest reply: Feb 3, 2014 7:28 PM by jschellSomeoneStoleMyAlias RSS

    String reference equality

    Prem

      I don't understand why following code when executed returns false

       

      String s1= " string".trim();
      
        if(s1 == "string"){
        System.out.println("true");
        }
        else{
        System.out.println("false");
        }