Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class Fortune
- {
- public static final String[] fortunes = {
- "Love",
- "Luck",
- "Money",
- "Bad luck"
- };
- public static String returnRandomString()
- {
- Random random = new Random();
- String randomString = fortunes[random.nextInt(fortunes.length)];
- return randomString;
- }
- public static void main(String[] args)
- {
- for (int i = 0; i < 10; i++) {
- System.out.println(returnRandomString());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement