previous | start | next

Writing a toString() Method: 1

What is needed to write a toString() method for a class?

Answer: We will usually want to provide a string representation that includes all the data member values of the instance.

So the more general problem is how to convert a collection of different data type values to a single string!



previous | start | next