Java中产生随机数的方法有以下几种:
double randomNum = Math.random();
Random random = new Random();
int randomInt = random.nextInt();
double randomDouble = random.nextDouble();
int randomInt = ThreadLocalRandom.current().nextInt();
double randomDouble = ThreadLocalRandom.current().nextDouble();
SecureRandom secureRandom = new SecureRandom();
int randomInt = secureRandom.nextInt();
以上就是Java中产生随机数的几种方法,根据具体的需求选择适合的方法。