Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class Main {
- public static void main(String[] args) {
- RandomNumber user = new RandomNumber();
- String names = ["George", "Fred", "Jaxon", "Maddy", "Fredrick", "Amy", "Devin", "Connor", "Dylan", "Macncheese", "Predunce", "CattleDogMan", "Catman", "Jackson", "Mattie"];
- int random = user.createNum(0, 14);
- String user2 = names[random];
- System.out.println("Hello " + user2);
- }
- }
- public class RandomNumber {
- public static createNum(min, max) {
- int firstnum = (Math.random() * max) + min;
- return firstnum;
- }
- }
- public class Main {
- public static void main(String[] args) {
- String[] names = {"George", "Fred", "Jaxon", "Maddy", "Fredrick", "Amy", "Devin", "Connor", "Dylan", "Macncheese", "Predunce", "CattleDogMan", "Catman", "Jackson", "Mattie"};
- int random = createNum(0, 14);
- String user2 = names[random];
- System.out.println("Hello " + user2);
- }
- public static int createNum(int min, int max) {
- int firstnum = (int) ((Math.random() * max) + min);
- return firstnum;
- }
- }
Add Comment
Please, Sign In to add comment