Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Tremayne Clinton
5,417 Pointswhat am I missing
can't get this
Random randomGenerator = new Random();
int randomNumber = randomGenerator.nextInt(10);
intAsString = intAsString [randomNumber] ; // delete
intAsString = randomNumber + ""; // delete
1 Answer

Steve Hunter
57,684 PointsHi Tremayne,
You're just missing the last line.
Add an empty string to randomNumber
and assign that (with an equals sign) into intAsString
.
String intAsString = randomNumber + "";
This converts the int
, called randomNumber
into a string and stores it in intAsString
.
Let me know how you get on.
Steve.
Steve Hunter
57,684 PointsSteve Hunter
57,684 PointsI added comments in your code; then follow the post below.
