Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class Die
- {
- private int num;
- public Die()
- {
- Random rand = new Random();
- this.num = rand.nextInt(6)+1;
- }
- public void roll()
- {
- Random rand = new Random();
- this.num = rand.nextInt(6)+1;
- }
- public int getNum()
- {
- return this.num;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement