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 trialJorge Hurtado
1,675 PointsBummer! Check the parameter you're using for 'nextInt()'. Hint: 0 through 9 is a total of 10 choices.
im having a problem with this coding. i entered int randomNumber = randomGenerator();
2 Answers
william parrish
13,774 PointsWell, from what i remember, and what the error message is prompting you, you did not define the range for your random numbers.
If its asking you to generate random numbers, you will as indicated need to put in 10 : int randomNumber =randomGenerator(10); A good rule of thumb, is since the random number generator starts with / includes 0, just add 1 to whatever your literal limit is. IE random numbers stopping at '25' would be 26, and so on.
Jason Anello
Courses Plus Student 94,610 PointsYour code is somewhat incomplete there. What's the code you used to pass task 2?