โ Back to Methods
Question 255
Absolute Value Method
Absolute Value Method
Complete the static method absValue so it returns the absolute value of its parameter (its distance from zero) WITHOUT using Math.abs.
For absValue(-7) the program prints 7.Expected Output:
7 4
Topics:
Methods
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.