Java Programming Tutorial - Random Number Generator on October 01, 2018 Get link Facebook X Pinterest Email Other Apps import java.util.Random; public class Coffee{ public static void main(String arg[]) { Random dice = new Random (); int number; for(int counter = 1; counter<=10; counter++) { number = 1+dice.nextInt(6); System.out.println(number + " "); } } } Comments
Comments
Post a Comment