Math: abs(int value) : Math « java.lang « Java by API
- Java by API
- java.lang
- Math
Math: abs(int value)
/*
* Output:
Absolute value of -18 is 18
*/
public class MainClass {
public static void main(String args[]) {
System.out.println("Absolute value of -18 is " +
Math.abs(-18));
}
}
Related examples in the same category