CJCoding With Joseph
15free / daySign inCreate account

Implement Resizable Interface

An interface Resizable is provided with two methods: void resize(double factor) and double getSize().

Create a Box class that implements Resizable.

Requirements:
1. Box has a double side field set by the constructor.
2. resize(double factor) multiplies side by the factor.
3. getSize() returns the current value of side.

Do NOT write a main method.

Expected Output:

10.0
25.0

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
InterfacesClasses
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · 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.