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!
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

Phil White
Courses Plus Student 9,519 PointsStuck on this question in Android development
Declare a String variable named intAsString. Convert the randomNumber integer to a String value and store it in the intAsString variable. Hint: "Moosh" them together like in the video!
2 Answers

Kate Hoferkamp
5,205 PointsWhen it says to "moosh them together" it wants you to concatenate it so that the String value overrides the int and automatically converts it to a String value.
All you have to do is
String intAsString = "" + randomNumber;

Joseph Greevy
4,990 PointsI may be getting mixed up with programming languages so forgive me if I am wrong but i believe the task is accomplished like so:
Random randomGenerator = new Random();
int randomNumber = randomGenerator.nextInt(3);
String intAsString = string(randomNumber);
Phil White
Courses Plus Student 9,519 PointsPhil White
Courses Plus Student 9,519 PointsThis is the code you start with