Class Die

public class Die
extends java.lang.Object

Die class simulates a die object.


Field Summary
private  int face
           
 
Constructor Summary
Die()
          Constructs a new die object, initializing face to a random value.
 
Method Summary
 int getFace()
          Gets the current face value of the die.
 int roll()
          Simulates the roll of the die.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

face

private int face
Constructor Detail

Die

public Die()
Constructs a new die object, initializing face to a random value.

Method Detail

roll

public int roll()
Simulates the roll of the die.

Returns:
The new face value of the die

getFace

public int getFace()
Gets the current face value of the die.

Returns:
The current face value of the die