java random max and min

54

java random max and min -

Random random = new Random();
int max = 10;
int min = 1;

int result = random.nextInt(max + 1 - min) + min;

Comments

Submit
0 Comments