The Java Math class has many methods that allows you to perform mathematical tasks on numbers.
Math.max(x,y) method can be used to find the highest value of x and
Math.min(x,y) method can be used to find the lowest value of of x
Math.sqrt(x) method returns the square root of x:
Math.abs(x) method returns the absolute (positive) value of x:
Math.random() returns a random number between 0 (inclusive), and 1 (exclusive):
Complete Math Reference
For a complete reference of Math methods, go to our Java Math Methods Reference.
The reference contains descriptions and examples of all math methods.