I want to create a method where I will give parameter of size and create an array of random strings with each having at least 3 and at most 8 lower case letters, inclusive.
Edit: This is what I tried :
public static String[] makeRandomStringList(int size) {
String[] str = new String[size];
for (int i =0; i <size ; i++) {
str[i]= randomFill();
}
return str;
}
public static String randomFill() {
Random rd = new Random();
String randomNum = rd.nextLine();//nextLine() is undefined for random type so I don't know what else to do.
return randomNum;
}
Aucun commentaire:
Enregistrer un commentaire