This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
According to Java API for the trim method, "if there is no character with a code greater than '\u0020' in the string, then a new String object representing an empty string is created and returned." So in this case it is just returning an empty string. Since, java optimises String usage by putting them on a common shared pool wherever possible, there is actually only one empty String object created and both point to the same object. That is why the comparison returns Equal. Hope it helps. Dinesh SCJP 1.4