โ Back to Polymorphism
Question 555
Implement an Abstract Method
Implement an Abstract Method
TheabstractclassShapedeclares an abstract methodAreawith no body. Provide the body in theRectanglesubclass so it returnsWidth * Height. An abstract method MUST be implemented by any concrete subclass. Do NOT write aMainmethod. Fornew Rectangle(3, 4)the program prints: 12
Expected Output:
12
Topics:
Polymorphism
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.