Generating a Random Number Random rand = new Random(); int rnum = rand.nextInt(); // Continually call nextInt() for more random //integers.