Advertisement
Guest User

mosheeeee

a guest
Nov 23rd, 2014
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.28 KB | None | 0 0
  1. import java.util.Random;
  2.  
  3. public class Die
  4. {
  5. private int num;
  6. public Die()
  7. {
  8. Random rand = new Random();
  9. this.num = rand.nextInt(6)+1;
  10. }
  11. public void roll()
  12. {
  13. Random rand = new Random();
  14. this.num = rand.nextInt(6)+1;
  15. }
  16. public int getNum()
  17. {
  18. return this.num;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement