Math common methods
package cn.kgc.common; public class TestMath { public static void main(String[] args) { //Generate a random number between 1-9 int i=(int)(Math.random()*10); System.out.println(i); //return absolute value System.out.println(Math.abs(-3)); //return the maximum value System.out.println(Math.max(2.5,90)); } }