CJCoding With Joseph
15per day

Overloaded Area Methods

Method overloading means two methods can share a name if their parameters differ. Write TWO static methods named Area:
- Area(int side) returns side * side (a square)
- Area(int width, int height) returns width * height (a rectangle)

Do NOT write a Main method. For Area(5) it prints 25; for Area(4, 6) it prints 24.

Expected Output:

25
24
Topics:
Methods
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.