reset password
Author Message
knagrec2
Posts: 51
Posted 11:23 Sep 09, 2018 |

When it asks to return a string representation, do you want it to actually have a return type defined as String? Or is it ok for it to just print out the values (using a for loop) in such a way that it looks like your example?

kknaur
Posts: 540
Posted 11:49 Sep 09, 2018 |

You should look at the special toString() method.  toString() returns a string, so that is how it should be designed.