Java Absolute Value
Java abs() method
Java standard class library includes an absolute value method, called abs(). Java abs() method is overloaded by Math class to handle all the primitive types. Java determines which version of the abs() method to call. It depends on the type of argument.
In Java, we can find the absolute value by using the abs() method. It belongs to java.lang.Math class. It is an overloaded method. It returns the absolute value of an argument. The argument can be of any type such as int, float, double, long, and short. The signature of the method is:
Where x is an argument whose absolute value is to be determined.
Points to remember
9 3.14 9.5 Min value of integer is: -2147483648 Min value of long is: -922337203685477808 NaN Infinity
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week