Chapter 5 Print and Summary Methods
Every class should have a
print
method that gives a concise description of the object.The
print
method should invisibly return the original object.The number of significant digits should be an option and should use the global default.
Printing the call is discouraged.
summary
methods are helpful but not required. These should create more verbose descriptions of the object. Theprint
method for thesummary
object should follow the bullet-pointed remarks above for printing.