Let a Parent-Type Parameter Pick the Right Override
easyQuestion 511Parrot and Owl both extend Bird and override sound(). A parameter of type Bird accepts any of the three, and when a method is called on it Java runs the version that belongs to the real object. Complete introduce in the Aviary class.
Requirements:
1. introduce(Bird bird) returns the bird's name, the word says and the bird's sound, separated by single spaces. A parrot named Polly gives Polly says Hello.
2. Do not test which kind of bird it is. Call getName() and sound() on the parameter and let Java pick the right sound().
The Bird, Parrot and Owl classes are provided. Do not change them. The tests also pass a kind of bird that is not in this file.
Do NOT write a main method.
Expected output
Polly says Hello Olive says Hoot Robin says ...
= newline. The output ends with a newline, so print one after the last line.
Your output
Run your code to see the output here...