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 trial

Android Build a Simple Android App (retired 2014) Learning the Language Objects and Random Numbers

Neo ighodaro
Neo ighodaro
1,391 Points

Does not get past one of the Challenges in Android Development

In one of the challenges in the track "Android Development" chapter 2, The task is to generate a random number of range 0 to 9 and the correct answer seems to be:

Random randomGenerator = new Random(); int randomNumber = randomGenerator.nextInt(8);

but that returns an error saying to check the parameter: Hint: 0 - 9 has a total of 10 values.

Ben Jakuben

Neo ighodaro
Neo ighodaro
1,391 Points

I misread the question sorry ignore this.

1 Answer