Implement Two Interfaces in One Class
easyQuestion 524A class can extend only one class, but it can implement any number of interfaces: list them after implements with commas between. Duck implements both Swimmer and Flyer, so it owes a body for the method of each. Complete the two methods.
Requirements:
1. swim() returns the name of the duck followed by paddles across the pond.
2. fly() returns the name of the duck followed by flaps into the air.
3. There is exactly one space between the name and the rest. A duck named Mo swims as Mo paddles across the pond.
4. Do not change the two interfaces.
Do NOT write a main method.
Expected output
Daisy paddles across the pond Daisy flaps into the air
= newline. The output ends with a newline, so print one after the last line.
Hints2 available
Sign in to use hintsTopics
InterfacesClasses
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.