import java.util.Random; int rndNumber; Random rnd = new Random(); //rnd is the name of the randomizer rndNumber = 1 + rnd.nextInt(9); //int between 1-9