Also the print() and println() methods (println() adds a carriage return, print() does not) when passed an Object, automatically uses that object's toString() method to render the output. In the case of a
String object, this is the string value of the object. In the event of another kind of object it is either the result of an overridden implentation of toString() or Object.toString() (which all objects inherit and, if not overriden, which prints the object's class name + @ + hexadecimal representation of the hash code of the object).
From the Object javadocs:
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. In other words, this method returns a string equal to the value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
--BW
[ November 25, 2003: Message edited by: Brian R. Wainwright ]