publicclassTestRef { publicstaticvoidmain(String[] args) { Strings=newString( "a" ); if (s == "a" ) System.out.println( " true1 " ); if (s.equals( "a" )) System.out.println( " true2 " ); Stringss="a" ; if (ss == "a" ) System.out.println( " true3 " ); if (ss.equals( "a" )) System.out.println( " true4 " ); } }