Page 254 - AP Computer Science A, 7th edition
P. 254
Methods in Object
There are many methods in Object, all of them inherited by every other class. Since Object is not an abstract class, all of its methods have implementations. The expectation is that these methods will be overridden in any class where the default implementation is not suitable. The methods of Object in the AP Java subset are toString and equals.
THE toString METHOD public String toString()
This method returns a version of your object in String form.
When you attempt to print an object, the inherited default toString method is invoked, and what you will see is the class name followed by an @ followed by a meaningless number (the
address in memory of the object). For example,
SavingsAccount s = new SavingsAccount(500); System.out.println(s);
produces something like