PoeticalJustice

导航

常用类一一MATH类一一两个静态常量PI 和E,一些数学函数。

package test;

public class MathTest {
    public static void main(String[] args) {
        System.out.println(Math.abs(-40.3));
        System.out.println(Math.abs(40.3));
        System.out.println(Math.max(5,6));
        int i = (int)(Math.random()*10);//  生成0-9随机数
        System.out.println(i);
        System.out.println(Math.abs(-40.3));
    }
}

 

40.3
40.3
6
4
40.3

 

posted on 2017-10-14 09:35  PoeticalJustice  阅读(693)  评论(0编辑  收藏  举报