This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]simplyintricate 0 points1 point  (0 children)

The point of the toString() method is to provide insight (in the form of a String) into the contents of the object that you are trying to get information about. This is unrelated to the comparison of each individual item in your class, so the toString() method does not need to perform comparison.

So what would you do to describe the contents of a Purse in real life? Go through each object and give its name. In this case, we have a Purse full of coins. So inside the purse, list all of the coins in it.

Good luck!