/* Java. the math class in the lang Package provides constants * and contains * methods for performing basic mathematical operations, such as Elementary Indexes, logarithm, and square root * for more advanced mathematical operations. * Because the methods in the math class are static, you can call * Math directly through the class. cos (angle); * (using the language feature of static import "Import static Java. lang. math. * "* You don't have to write math before every mathematical function. This allows you to call methods in the math class by a simple * name, for example, "cos (sngle )"! **/Public class Hello {public static void main (string [] ARGs) {/* 1. constant and Basic Method * Math contain two constants * 1> math. e: represents the base number of the natural logarithm. Double type * 2> math. pi: circumference rate. The double type * Math class contains more than 40 static methods */Double A =-191.635; Double B = 41.94; int c = 27, D = 65; system. out. printf ("%. the absolute value of 3f is %. 3f % N ", A, math. ABS (a); system. out. printf ("ratio %. the smallest integer of 2f is %. 0f % N ", B, math. ceil (B); system. out. printf ("ratio %. the maximum integer of 2f is %. 0f % N ", B, math. floor (B )); /* exponent and logarithm Method * exp natural logarithm E Power * log parameter natural logarithm * The second power of the first parameter of Pow * SPRT returns the square root of the parameter */double X = 12.715; double Y = 3.96; system. out. printf ("the base of the natural number is: %. 4f % N ", math. e); system. out. printf ("exp (%. 3f) is %. 3f % N ", X, math. exp (x); system. out. printf ("log (%. 3f) is %. 3f % N ", X, math. log (x); system. out. printf ("SQRT (%. 3f) is %. 3f % N ", X, math. SQRT (x);/** Random Number * random () of the math class () the static method returns a random number * between 0.0 and 1.0. The range contains 0.0, but not 1.0. * if you want to generate a 0-9 integer * You can use int number = (INT) (math. random () * 10) */system. out. print (INT) (math. random () * 10 ));}}