absolute value java

Solutions on MaxInterview for absolute value java by the best coders in the world

showing results for - "absolute value java"
Elijah
29 Apr 2020
1import java.lang.Math;
2int sum,x=-5;
3sum = Math.abs(x);
Sara
28 May 2016
1public class Test { 
2
3   public static void main(String args[]) {
4      Integer a = -8;
5      double d = -100;
6      float f = -90;
7
8      System.out.println(Math.abs(a));
9      System.out.println(Math.abs(d));     
10      System.out.println(Math.abs(f));    
11   }
12}
Michela
15 Nov 2018
1abs(intx);