By dotCore
via dreamincode.net
Published: Jan 12 2011 / 21:16
The toString() method solves so many question that we see these days in the forums, and it is crucially important to understand it. It is a method that is defined in the Object class and thus, every object has one, however, it prints out, for the most part, meaningless information.
Comments
lburnham123 replied ago:
Summary: override toString() to provide a string representation of an object.
saifuddin.merchant replied ago:
I guess its more of a tip/tutorial for beginners - I would have loved to see a mention of org.apache.commons.lang.builder.ToStringBuilder - specifically the http://commons.apache.org/lang/api-2.5/org/apache/commons/lang/builder/ReflectionToStringBuilder.html
Voters For This Link (7)
Voters Against This Link (0)