โ Back to Interfaces
Question 602
Compute Area Through an Interface
Compute Area Through an Interface
The interfaceIShapedeclaresdouble Area(). TheRectangleclass stores a width and height. CompleteArea()so it returns width times height. Do NOT write aMainmethod. For aRectanglewith width 3 and height 4 the program prints: 12
Expected Output:
12
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.