1import java.util.Random;
2
3Random rand = new Random();
4int maxNumber = 10;
5
6int randomNumber = rand.nextInt(maxNumber) + 1;
7
8System.out.println(randomNumber);
1import java.util.Random;
2
3Random rndm = new Random();
4int mnmbr = 10;
5
6int rndNumber = rndm.nextInt(mnumber) + 1;
7
8System.out.println(rndNumber);