How do you do this???
Initialize a new Random variable called randomGenerator. Hint: Don't forget to use the new keyword.
Random randomGenerator; int randomNumber = randomGenerator.nextInt( facts.length); String fact = facts [randomNumber] ; factTextView.setText(fact);
Steve HunterTreehouse Moderator 57,652 Points
The code starts with a variable named
randomGenerator of type
Random. What you need to do is to put a
new random number in that variable. To do this, you call the constructor by using the new keyword - the constructor is always called the same as the class and has brackets after it. So, here you will end up with:
Random randomGenerator = new Random();
I hope that helps.