โ Back to Interfaces
Question 610
Implement Two Interfaces
Implement Two Interfaces
A class can implement more than one interface.IWalkerdeclaresWalk()andISwimmerdeclaresSwim(). MakeDuckimplement BOTH soWalk()returnsDuck is walkingandSwim()returnsDuck is swimming. Do NOT write aMainmethod. The program prints: Duck is walking Duck is swimming
Expected Output:
Duck is walking Duck is swimming
Topics:
Interfaces
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.