Java math.BigDecimal.abs() method

Last Updated : 17 Mar 2025

The java.math.BigDecimal.add() method is used to find out the absolute value of any number.

abs() method does not take any parameter.

Syntax

Example 1

Output:

Abs is=40

Example 2

Output:

Enter first number:
-40
Abs is=40
 
Next TopicJava Math