// Using Math methods: some examples public class MathMethods { /** Main method */ public static void main(String[] args) { double i = 5.0; int j = 23; double x, y, z, a; x = Math.sqrt( j ); // overloading the function y = Math.pow(i,3); z = Math.exp( i ); a = (int)(Math.random()*10); System.out.println("The square root of "+j+ " is "+x); System.out.println(i+" cubed is " + y); System.out.println("The natural log of "+i+" is "+z); System.out.println("A random number from 1-10 is "+a); System.out.println("PI has a value of " + Math.PI); } }