Advertisement
jaredt17

Chapter2Exercise11

Sep 27th, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. import java.awt.Rectangle;
  2. import java.util.Random;
  3. public class ch2Review
  4. {
  5.  
  6.     public static void main(String[] args)
  7.     {  
  8.         Random rand = new Random();
  9.        
  10.         int rollTheDie = rand.nextInt(7);
  11.         if(rollTheDie == 0)
  12.         {
  13.             rollTheDie = rand.nextInt(7);
  14.         }
  15.         System.out.println(rollTheDie);
  16.        
  17.  
  18.     }
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement