random number generator between range in java code example
Example 1: java random usage
import java.util.Random;
Random rndm = new Random();
int mnmbr = 10;
int rndNumber = rndm.nextInt(mnumber) + 1;
System.out.println(rndNumber);
Example 2: random in java a to b
Min + (int)(Math.random() * ((Max - Min) + 1))