Online Java Compiler By
JavaTpoint.com
public class AbsExample3 { public static void main(String args[]) { float x = -73.02f; float y = -428.0f; //print the absolute value of float type System.out.println(Math.abs(x)); System.out.println(Math.abs(y)); } }
Output