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 Basic Android Programming Using the Random Class

I dont now what happend with this error

I created the new random ut the program said no no no

RandomTest.java
Random randomGenerator = new random();
int randomNumber=randomGenerator.nextInt(3)
  fact=randomNumber + "";

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

You're on the right track with the first two lines. On task 3 of that challenge you need to use a number that will give you 10 values (0-9), but you have a 3, which will only give you a random number in the range between 0 and 2.

Then for task 4 (line 3), you need to create a new String variable named intAsString. You are trying to use a fact variable that doesn't exist in this challenge.