โ Back to Interfaces
Question 606
Properties and a Method Together
Properties and a Method Together
The interfaceIRectangledeclares two read-only properties,WidthandHeight, plus anArea()method. TheBoxclass already exposesWidthandHeight. CompleteArea()so it returnsWidth * Height. Do NOT write aMainmethod. For aBoxwith width 4 and height 5 the program prints: 20
Expected Output:
20
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.