java获取随机数
public static int getRandom(int start, int end) {
BigDecimal max = BigDecimal.valueOf(end + 2);
BigDecimal min = BigDecimal.valueOf(start);
int random;
do {
random = max.subtract(min).multiply(BigDecimal.valueOf(Math.random())).add(min).setScale(0, RoundingMode.HALF_UP).intValue();
} while (random == start || random == end + 2);
return random - 1;
}