9 Replies Latest reply on Feb 4, 2014 1:28 AM by jschellSomeoneStoleMyAlias

    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");
        }