Java - random number

int randomNum = ThreadLocalRandom.current().nextInt(min, max + 1);
Min + (int)(Math.random() * ((Max - Min) + 1))

你可能感兴趣的:(Java - random number)