Define a method named whisper
.
whisper
should accept a single Pet
instance and return a String?
.
If the pet is:
Cat
you should return the result of calling meow()
Dog
you should return the result of calling woof()
Snake
you should return the result of calling hiss()
null
.Stuck? You may find these lessons helpful: