Advertisement
thenewboston

Java Programming Tutorial - 26 - Random Number Generator

Aug 22nd, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1. import java.util.Random;
  2.  
  3. class apples{
  4.    public static void main(String[] args){
  5.       Random dice = new Random();
  6.       int number;
  7.  
  8.       for(int counter=1; counter<=10;counter++){
  9.           number = dice.nextInt(6);
  10.           System.out.println(number + " ");
  11.       }
  12.    }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement