The question is actually about Strings and not a wrapper class.
Since it is using the == instead of the .equals() method, it is checking for objects being the same, pointing to the same point in memory. Not the
string's value.
So when you call toString it creates a new String object, so there are two different String objects created in the if statement, and they are not the same, they are not pointing to the same object in memory.
Mark