Online Java Compiler By
JavaTpoint.com
public class AbsExample4 { public static void main(String args[]) { long x = 78730343; long y = -4839233; //print the absolute value of long type System.out.println(Math.abs(x)); System.out.println(Math.abs(y)); System.out.println(Math.abs(Long.MIN_VALUE)); } }
Output