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 trialUros Dukic
1,001 Pointsandroid coding problem
I have problem in code challenge.In preview I got this massage.
JavaTester.java:21: ';' expected int randomNumber +""; ^ 1 error
3 Answers
Eric De Wildt
Courses Plus Student 13,077 PointsThe problem is with your syntax and how you interpreted the instructions. Your code is almost correct, it should look like this:
Random randomGenerator = new Random();
Stefan Buttigieg
10,065 PointsThe answer is much simpler than you think :)
Initialize a new Random variable called randomGenerator using the Random() constructor.
And you already have : Random randomGenerator;
Random = Type of variable randomGenerator = variable name
What should follow after that ? the Random() constructor
How do you initialize? new Random()
Always close with ';'
Connect the statements ;) Get your thinking cap on :)! It sounds difficult now but you will get it with more practice.
Eric De Wildt
Courses Plus Student 13,077 PointsIf you are still stuck then lets have a look at your code and we can figure it out together.Please post the code you are trying to use.
MUZ140073 Lionell Matambanadzo
12,509 PointsRandom randomGenerator=newRandomConstructor(); pliz help me
MUZ140073 Lionell Matambanadzo
12,509 PointsMUZ140073 Lionell Matambanadzo
12,509 Pointsthank you
Eric De Wildt
Courses Plus Student 13,077 PointsEric De Wildt
Courses Plus Student 13,077 PointsYour welcome, please vote my answer as best if it was please.