public class Dice
extends java.lang.Object
Constructor and Description |
---|
Dice()
Constructs a standard Dice
|
Dice(int nSides)
Constructs a dice with a specified number of sides
|
Modifier and Type | Method and Description |
---|---|
int |
getValue()
Gets the current value of the dice
|
static void |
main(java.lang.String[] args) |
void |
roll()
Rolls the dice.
|
java.lang.String |
toString() |
public Dice()
public Dice(int nSides)
nSides
- number of sidespublic int getValue()
public void roll()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args) throws java.lang.InterruptedException
java.lang.InterruptedException