โ Back to Interfaces
Question 611
Interface Inheritance
Interface Inheritance
One interface can extend another.IPetextendsIAnimal, so a class implementingIPetmust supplyName()(fromIAnimal) ANDOwner(). Complete theCatclass soName()returns the stored name andOwner()returns the stored owner. Do NOT write aMainmethod. For aCatnamedWhiskersowned bySamthe program prints: Whiskers Sam
Expected Output:
Whiskers Sam
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.