--Simple random numbers
new Random().nextXxx();
new Random().nextXxx(10);
--Non-duplicate random number list
new Random().ints(0, Integer.MAX_VALUE)
.distinct()
.limit(10)
.boxed()
.collect(Collectors.toList())
--List random number acquisition
list.get(random.nextInt(list.size()));
Recommended Posts