Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dice;
- /**
- *
- * @author phani
- */
- public class Dices {
- private int dice1;
- private int dice2;
- public Dices(){
- rollDice();
- }
- public void rollDice(){
- dice1 = (int)(Math.random()*6)+1;
- dice2 = (int)(Math.random()*6)+1;
- }
- public int getDice1(){
- return dice1;
- }
- public int getDice2(){
- return dice2;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement