LyonJay
asked on
Random number generator between 0 - 100
I am trying to create a number generator between 0 - 100, this my code atm:
Could someone help me out?
Cheers
Could someone help me out?
Cheers
private void newGame()
{
numGames = i++;
java.util.Random rand = new java.util.Random();
i =rand.nextInt(100+1);
theNumber = i;
}
whats the issue?
ASKER
it's giving me cannot find symbol?
Is it a import issue?
Regards
Lyon JT
Is it a import issue?
Regards
Lyon JT
which line?
ASKER
6, 7
Regards
Lyon JT
Regards
Lyon JT
post the full code of the class otherwise!
try
int i = rand.nextInt(100+1);
theNumber = i;
int i = rand.nextInt(100+1);
theNumber = i;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.