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
Brian Jones715 Points
I still need help it gives me a error when I put in the following code?
Random randomGenerator = new Random(); int randomNumber = randomGenerator.nextInt(30); String myString = Integer.toString(someInt);
Stone Preston42,016 Points
the code I gave you was just an example. not the real answer to the challenge. the challenge states:Declare a String variable named intAsString. Convert the randomNumber integer to a String value and store it in the intAsString variable. Hint: Use the toString() method of the Integer class.
so your string variable needs to be named intAsString, not someString. also you need to use the integer you have already defined as randomNumber as the argument for your toString method call.