Link to home
Start Free TrialLog in
Avatar of LyonJay
LyonJayFlag for United Kingdom of Great Britain and Northern Ireland

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


private void newGame()
	{
		
		numGames = i++;
		java.util.Random rand = new java.util.Random();
		i =rand.nextInt(100+1);
		theNumber = i;
	}

Open in new window

Avatar of ksivananth
ksivananth
Flag of United States of America image

whats the issue?
Avatar of LyonJay

ASKER

it's giving me cannot find symbol?

Is it a import issue?

Regards

Lyon JT
which line?
Avatar of LyonJay

ASKER

6, 7

Regards

Lyon JT
post the full code of the class otherwise!
try

int i = rand.nextInt(100+1);
theNumber = i;
ASKER CERTIFIED SOLUTION
Avatar of ksivananth
ksivananth
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial