lundi 21 novembre 2016

i need to generate a random word chosen from 6 hidden words using an array in jframe

String[] FindWord = {"hello", "photo", "table", "page", "flower","salad"}; 
List<String> names = Arrays.asList(FindWord); 
int indexOf= new Random().nextInt(names.size());  
String name= names.get(indexOf);




Aucun commentaire:

Enregistrer un commentaire