Java / Strings
What is toString() method?
Returns a string representation of an(y) object. The toString() method returns a string that textually represents this object.
The toString method for any 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:
Overriding toString() method yields desired and more readable output of the object.
More Related questions...
instanceofCloneable is checked? What is the default implementation of equals method in Object class.