java.lang.Math.abs(int a)


java.lang.Math.abs(int a)

package com.codingdict;



import java.lang.*;



public class MathDemo {



   public static void main(String[] args) {



      // get some integers to find their absolute values

      int x = 175;

      int y = -184;



      // get and print their absolute values

      System.out.println("Math.abs(" + x + ")=" + Math.abs(x));

      System.out.println("Math.abs(" + y + ")=" + Math.abs(y));

      System.out.println("Math.abs(-0)=" + Math.abs(-0));

   }

}