All pastes #676957 Raw Edit

Miscellany

public text v1 · immutable
#676957 ·published 2007-08-31 15:27 UTC
rendered paste body
import java.util.Random;

public class Die {
	private int value;
	
	//constructor
	public Die(){
		value = 0; //initialize the value.
	}
	
	//get a random value
	public void roll(){
		Random generator = new Random();
		value = generator.nextInt(6) + 1;
	}
	
	//return the resultant.
	public int getValue()
	{
		return value;
	}
}