Online Java Compiler By
JavaTpoint.com
public class AbsExample1 { public static void main(String args[]) { int x = 78; int y = -48; //print the absolute value of int type System.out.println(Math.abs(x)); System.out.println(Math.abs(y)); System.out.println(Math.abs(Integer.MIN_VALUE)); } }
Output