Android Build a Simple Android App Basic Android Programming Using the Random Class

Declan Smith
Declan Smith
453 Points

Random int

Making the random generator with an Int. im writting out int randomNumber = randomGenerator.nextInt();

It is the exact same as done in the video, and still not working

RandomTest.java
Random randomGenerator = new Random ();
int randomNumber = randomGenerator.nextint();

1 Answer

Ben Deitch
STAFF
Ben Deitch
Treehouse Teacher

Hey Declan!

You just need to use an uppercase I.

E.g.

Random randomGenerator = new Random ();
int randomNumber = randomGenerator.nextInt();

Hope that helps!