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

Jorge Ponce
Jorge Ponce
2,003 Points

Create a String variable named intAsString. Convert the randomNumber integer to a String value and store it in the intAs

I dont understan because he said creat intAsString becuse i saw the video and make like this the video and mark a error. please help
 String[] facts = {
                        "It takes about 8 minutes for light from the Sun to reach Earth.",
                        "Some bamboo plants can grow almost a meter in just one day.",
                        "The state of Florida is bigger than England.",
                        "Some penguins can leap 2-3 meters out of the water.",
                        "On average, it takes 66 days to form a new habit.",
                        "Mammoths still walked the earth when the Great Pyramid was being built.",

                String fact = "";
Random randomGenerator = new Random();
int randomNumber = randomGenerator.nextInt(facts.length);
fact = facts [randomNumber];

1 Answer

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Hi Jorge Ponce , are you still having trouble with this challenge? It looks like you've gotten some good answers on your other posts about this. This one has a great explanation from Jason about what you need to do:

Jorge Ponce
Jorge Ponce
2,003 Points

THanks a lot everyone