โ Back to Classes
Question 198
Implement Resizable Interface
Implement Resizable Interface
An interfaceResizableis provided with two methods:void resize(double factor)anddouble getSize(). Create aBoxclass that implementsResizable. Requirements: 1.Boxhas adouble sidefield set by the constructor. 2.resize(double factor)multipliessideby the factor. 3.getSize()returns the current value ofside. Do NOT write a main method.
Expected Output:
10.0 25.0
Topics:
InterfacesClasses
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.