Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialmanuella akoury
719 PointsCreate a new int variable named randomNumber. Use the randomGenerator variable and its nextInt() method to get a random
i have no idea why it's not right
Random randomGenerator;
Random RandomGenerator = new Random();
int randomNumber = RandomGenerator.nextIntCalled();
nihouse
7,160 Pointsnihouse
7,160 PointsHi Manuella,
first of all: don't forget, that variables are case sensitive! (you have randomGenerator and RandomGenerator). But anyway, I think you don't need the first line you wrote, because in the second line you declare the variable, so you don't need to do it twice.
Now to you problem: I guess, that you should use nextInt() instead of nextIntCalled()
``` Random RandomGenerator = new Random(); int randomNumber = RandomGenerator.nextInt();
I didn't run the code, but I think this should work. If you want to limit the random number you can do nextInt(myLimit)