public class Die { private int sides; private int value; public Die(int sides) { this.sides = sides; } public int roll() { value = 1 + (int) (Math.random() * sides); return value; } public int getValue() { return value; } }