0
/ 50
The following Dog
class stores a String name
and an integer numSpots
that represents how many spots the dog has on its fur. It also...
The following Dog
class stores a String name
and an
integer numSpots
that
represents how many spots the dog has on its fur.
It also includes a toString()
method. For example:
Dog charlie = new Dog("Charlie", 3);
Invoking charlie.toString()
should return "Charlie has 3 spots!",
but the method is not working correctly.
Fix the toString()
method.
Your feedback will appear here when you check your answer.