solutions

Simple Animals Hierarchy

Extend the Animal class provided with three more subclasses: Cat, Dog, Human.

Include a method talk in each one of the subclasses. The talk method should return different options based on the type of animal:

  • Cat: should return "Meow!"
  • Dog: should return "Ruff!"
  • Human: should return "Hello!"

Test Cases

tests

[]