1/* First Method */
2int random = (int) (Math.random() * 100 + 1); /* Random number between 1 and 100*/
3int random = (int) (Math.random() * 65 + 1); /* Random number between 1 and 65*/
4/* Second Method */
5import java.util.Random;
6Random randnumber = new Random();
7int number = randnumber.nextInt(100); /* between 1 and 100*/
8system.out.println(number);
1public int getRandomNumber(int min, int max) {
2 return (int) ((Math.random() * (max - min)) + min);
3}