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