Welcome to the Treehouse Community
Looking to learn something new?
Josephine Dinesh476 Points
initialize a new Random Variable called randomGenerator
initialize a new Random Variable called randomGenerator Hint:Don't forget to add new keyword
Grigorij Schleifer10,363 Points
like Paul already said. Use this line of code to create a new Random object.
Random randomGenerator = new Random();
On the left side you see whats called variable declaration. You are creating a variable called "randomGenerator" and its type is Random. On the right side you are creating a new Object of a Random class using the keyword "new". The equals sign combines them together, so your new variable can use methods and field members from the Random class.
If you are asking yourself whats a class ... it is a blueprint where methods and different other variables are defined. The Random class has the nextInt() method you are using to generate a new integer. So to be able to use this methods, you create an Object of the Random class.
I hope that crears things up ....
Let us know if you need more information.