Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

package com.example.loqo.

myfirstapps;

import java.util.Random;

/**
* Created by loqo on 6/12/2017.
*/

public class FactBook {

public String[] mfacts = {


"Ant stretch when they woke up in the morning.",
"Ostriches can run faster than horse.",
"Olympic gold medal are actually made mostly of silver.",
"You are born with 300 bones: by the time you are an adult you will
have 206",
"It takes about 8 minutes for light form the Sun to reach Earth",
"Some bamboo plants can grow a mete in just one day.",
"The state of Florida is bigger than England.",
"Some penguins can leap 2-3 meters out of water.",
"On average, it take 66 days to form a new habit.",
"Mammoth still walking on earth when the Great Pyramid was being
built.",
"Tree house is actually not a tree."
};

public String getFacts(){


String facts = "0";

//Random class
Random randomGenerator = new Random();
int randomNumber = randomGenerator.nextInt(mfacts.length);
facts = mfacts[randomNumber];
return facts;
}
}

You might also like