Advertisement
Guest User

Untitled

a guest
Jun 28th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. package dice;
  2.  
  3. /**
  4.  *
  5.  * @author phani
  6.  */
  7. public class Dices {
  8.  
  9.     private int dice1;
  10.     private int dice2;
  11.  
  12.     public Dices(){
  13.         rollDice();
  14.     }
  15.  
  16.     public void rollDice(){
  17.         dice1 = (int)(Math.random()*6)+1;
  18.         dice2 = (int)(Math.random()*6)+1;
  19.     }
  20.  
  21.     public int getDice1(){
  22.         return dice1;
  23.     }
  24.     public int getDice2(){
  25.         return dice2;
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement