Read this piece of code carefully
if("String".toString() == "String")
System.out.println("Equal");
else
System.out.println("Not Equal");
------------------------------
if("
String ".trim() == "String")
System.out.println("Equal");
else
System.out.println("Not Equal");