java - toString() behavior of object when not overridden -
if tostring() method of class not overridden (or overloaded), , method returns string defined in class, happens when pass instance of class string expected?
if class extends object
, result of object#tostring()
, called. if class extends else, first #tostring
in inheritance path.
Comments
Post a Comment