Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Speaker {
- public static void main (String[] args) {
- String[] wordListOne = {"What's up","Hello","Good day","Good morning"};
- String[] wordListTwo = {"Sir","Brah","Miss","Mom"};
- String[] wordListThree = {"How are you?","Are you okay?","Let's play!","How you sleep?"};
- int oneListLength = wordListOne.length;
- int twoListLength = wordListTwo.length;
- int threeListLength = wordListThree.length;
- int randomListOne = (int) (Math.random()*oneListLength);
- int randomListTwo = (int) (Math.random()*twoListLength);
- int randomListThree = (int) (Math.random()*threeListLength);
- String phrase = wordListOne[randomListOne]+" "+wordListTwo[randomListTwo]+" "+wordListThree[randomListThree];
- System.out.println("generated greetings - "+phrase);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement