Task 6 of 7 · 0 solved · 7 to go0%
You can read the problem, but answers are checked only for signed-in students. Sign in to answer →

7.2 Overriding — override toString in Fish

Total: 0 / 3 pts
Practice mode — check each part and get hints as you go.
Task

Write Fish extends Animal that overrides toString() so it returns "Fish: " followed by the name.

main prints the object itself, so Java calls your toString automatically. The program prints Fish: Nemo.

Your solution