java 生成随机数 自定义


public static void main(String[] args) {
    int max=10000;
    int min=1000;
    Random random = new Random();
    int s = random.nextInt(max)%(max-min+1) + min;
    System.out.println(s);
}
posted @ 2019-10-16 16:02  ExpectoPatronum—S  阅读(459)  评论(0编辑  收藏  举报