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