the below given code gives "Not Equal". But as trim() returns a
string whose value is string used to invoke the method but with any leading or trailing blank spaces removed. So isn't the condition result in true and output be "Equal"?
if(" String ".trim() == "String")
System.out.println("Equal");
else
System.out.println("Not Equal");