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

Stuck on code challenge task 4 in Build a Simple Android App > Learning the Language > Objects and Random Numbers

I have tried

Random randomGenerator = new Random();
int randomNumber = randomGenerator.nextInt(10);
String intAsString = Integer.toString(randomNumer);

and

Random randomGenerator = new Random();
int randomNumber = randomGenerator.nextInt(10);
String intAsString; 
intAsString = Integer.toString(randomNumer);

I keep getting "Compilation Error! Check your syntax. Hint: Integer.toString(<plug in int variable here>)."

What am I doing wrong here?

1 Answer

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Just a typo! This is where a real IDE helps you out. You are missing the "b" in randomNumber in your last line. We would like to improve the Code Challenge engine in the future to help with errors like this.

Oh how did I not see that.

Thanks Ben