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