java random number algorithm code example
Example 1: random numbers java
int random = (int) (Math.random()*(max-min+1)+min);
Example 2: generate random number java
// JAVA - WITH A RANGE
(Math.random() * ((max - min) + 1)) + min
int random = (int) (Math.random()*(max-min+1)+min);
// JAVA - WITH A RANGE
(Math.random() * ((max - min) + 1)) + min