If you have not overridden the toString() method in your object's class, it will invokes the default implementation defined in the Object
class, which says:
The toString method for class Object returns a string consisting of the name of
the class of which the object is an instance, the at-sign character `@', and the
unsigned hexadecimal representation of the hash code of the object.
So, you will get the hashCode() representation of the Object , which may or may not be its address as it is implementation dependent. This is what Javadoc says about hashCode()
:
As much as is reasonably practical, the hashCode method defined by class Object
does return distinct integers for distinct objects. (This is typically
implemented by converting the internal address of the object into an integer,
but this implementation technique is not required by the JavaTM programming
language).