What dose it means
at Dice.rollDice(Dice.java:30)
java.lang.IllegalArgumentException: n must be positive
at java.util.Random.nextInt(Random.java:250)
at Dice.rollDice(Dice.java:30)
my code is :
import java.util.Random;
public class Dice
{
// instance variables.
private Random mRandom;
private int mSides;
/**
* Constructor for objects of class Dice
*/
public Dice(int sides)
{
sides = mSides;
mRandom = new Random();
}
public int rollDice()
{
return mRandom.nextInt(mSides);
}
}