|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectDice
This is a sample class that simulates a 6 sided die
| Constructor Summary | |
Dice()
The default constructor builds a 6-sided die |
|
Dice(int sides)
The constructor builds a die of the correct number of sides |
|
| Method Summary | |
int |
getLastRoll()
The getLastRoll method will return the last roll of the die |
int |
getSides()
The getSides method will return the number of sides on the die |
int |
rollDie()
The rollDie method returns a random number from 1 to numSides |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Dice(int sides)
sides - the number of sides on the created dicepublic Dice()
| Method Detail |
public int rollDie()
public int getLastRoll()
public int getSides()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||