public class Die
Die class simulates a six-sided die object, with the numbers 1-6 (inclusive, one number on each of its sides).
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 |
---|
private int face
Constructor Detail |
---|
public Die()
Method Detail |
---|
public int roll()
public int getFace()