The answer is that whoever wrote those exam papers likes to have a print() method. I don't usually write them as a routine myself. Once you have a toString method you can probably write a print() method very simply like this:-I shall leave you to work out how that print() method works for yourself. It is really quite simple.
Joined: Jun 21, 2013
Joined: Oct 13, 2005
subject: Exam question confusion - UML asks for print() method