[JAVA]生成随机数

public class GetRandomInit {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Random random = new Random();//默认以当前时间为随机数种子
        for(int i=0;i<5;++i){
            System.out.println(random.nextInt(100));//生成100以内的随机数
        }
    }
}
原文地址:https://www.cnblogs.com/zhengxl5566/p/9571222.html