RandomUtil.java 557 Bytes
package com.topdraw.util;

import java.util.Random;

public class RandomUtil {

    /**
     * 获取随机积分
     * @param max
     * @param min
     * @return
     */
    public static long getRandomPoints(Integer min,Integer max) {
        Random random = new Random();
        int s = random.nextInt(max)%(max-min+1) + min;
        return s;
    }

    public static void main(String[] args) {
        for (int i=0;i<30;i++) {
            long randomPoints = getRandomPoints(1, 10);
            System.out.println(randomPoints);
        }

    }

}