Calculate the absolute value in Java
Description
The following code shows how to calculate the absolute value.
Example
/*from ww w . j a va 2s . c o m*/
public class Main {
public static void main(String[] args) {
System.out.println(Math.abs(1 - 100));
}
}
The code above generates the following result.