/* The program will demonstrate how to use the Random class We will roll a dice from 1 to 6 * */ import java.util.Random; // Needed for the random class public class Dice { public static void main(String[] args) { Random rNumber = new Random(); // Here we add 1 because nextInt(6) only gives number from 0 to 5 int rn = rNumber.nextInt(6) + 1; System.out.println("You rolled a " + rn); } }