package chance; public class Die { //The Instance Variables, values to state private int order; private int top; //The Constructors public Die(){ order = 6; top=(int)((Math.random()+6)+1); } public Die(int NumberOfSides){ order=NumberOfSides; top=(int)((Math.random()+NumberOfSides)+1); } //The Methods public int top(){return top;} public void roll() { top =(int)((Math.random()*order)+1); } }