Class Dice
- java.lang.Object
-
- Dice
-
public class Dice extends java.lang.Object
Class that implements random dice.Have a look through the file to see how a simple object class is constructed. The dice class has a random number generator and an int number of sides. We can roll the die to get a random value in the game.
- See Also:
- Lab 4 Description, Dice is Singular of Dice
-
-
Constructor Summary
Constructors Constructor Description Dice(int sides)
Create a new dice with a given number of sides.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
roll()
Rolls our simulated dice.
-