WEB DEVELOPER SITE
PHP7
 

Java abs() Method


The method gives the absolute value of the argument. The argument can be int, float, long, double, short, byte.

Syntax

Following are all the variants of this method −

double abs(double d)
float abs(float f)
int abs(int i)
long abs(long lng)

Parameters

Here is the detail of parameters −

  • Any primitive data type.

Return Value

  • This method Returns the absolute value of the argument.
Run example »