Returns the absolute value of a number.
System.out.println(Math.abs(-5)); // 5
Returns the maximum of two numbers.
System.out.println(Math.max(10, 20)); // 20
Returns the minimum of two numbers.
System.out.println(Math.min(10, 20)); // 10
Returns the square root of a number.
System.out.println(Math.sqrt(25)); // 5.0
Returns the first number raised to the power of the second.
System.out.println(Math.pow(2, 3)); // 8.0
Returns the smallest integer greater than or equal to the number.
System.out.println(Math.ceil(5.3)); // 6.0
Returns the largest integer less than or equal to the number.
System.out.println(Math.floor(5.7)); // 5.0
Rounds the value to nearest integer.
System.out.println(Math.round(5.5)); // 6
Returns a random double between 0.0 and 1.0.
System.out.println(Math.random()); // e.g., 0.4832