Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
The Math.abs() method is a built-in function in Java that returns the absolute value of a number. It takes a single argument and can be used with both integer and floating-point numbers.
Related terms
Argument: An argument is the value that is passed into a method when it is called. In the case of Math.abs(), the argument is the number whose absolute value we want to find.
Built-in Function: A built-in function, like Math.abs(), is a pre-defined function provided by Java that performs a specific task. These functions are ready to use without requiring us to write any additional code.
Floating-Point Number: A floating-point number is a type of numeric data in Java that represents real numbers with fractional parts. It includes decimal values such as 3.14 or -0.5.