To print random number, you need to attach it to a variable. For example, int num=rand.nextInt();. Then, print that variable like normal. For a fixed range, if you want to start the range not starting at 0, you will add a start number (min). The range will go from min to max. For example, int num=rand.nextInt(max - min + 1) + min; int num=rand.nextInt(9) + 3; this range will goes from 3 to 11.