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 trialTremayne 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,712 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,712 PointsSteve Hunter
57,712 PointsI added comments in your code; then follow the post below.