•public class Die{
• public int value;
• // constructor of class Die
• public Die(){ value = 0; }
• // executed when an object of
class Die is constructed
• public void RollDie() {
• double tempvalue = Math.random() * 6;
• value = (int) Math.floor(tempvalue) + 1;
• }
•}