In both cases it's actually calling the toString() method. The default toString method for objects is to append the class name followed by the hashCode (default is the memory address).

For obvious...