publicclassMathDemo{publicstaticvoidmain(String[] args){// public static int abs(int a) 返回参数的绝对值
System.out.println(Math.abs(88));//输出88
System.out.println(Math.abs(-88));//输出88// public static double ceil(double a) 返回大于或等于参数的最小double值,等于一个整数
System.out.println(Math.ceil(88.4));//输出89
System.out.println(Math.ceil(88.8));//输出89// public static double floor(double a) 返回小于或等于参数的最大double值,等于一个整数
System.out.println(Math.floor(88.1));//输出88
System.out.println(Math.floor(88.9));//输出88// public static int round(float a) 按照四舍五入返回最近接参数的int
System.out.println(Math.round(88.1f));//输出88
System.out.println(Math.round(88.9f));//输出89// public static int max(int a,int b) 返回两个int值中的较大值
System.out.println(Math.max(88,89));//输出89// public static int min(int a,int b) 返回两个int值中的较小值
System.out.println(Math.min(88,89));//输出88// public static double pow 返回啊的b次幂的值
System.out.println(Math.pow(2,4));//输出2的4次幂 16// public static double random() 返回值为double的正值,[0.0,1.0]
System.out.println(Math.random());//随机0.0~1.0之间的double值(不包括0和1)}}