I've got this code, which (I hope) reads from a text file with 66 words and puts the words into an array.
BufferedReader buff = null;
String wordlist=new String[66];
int i=0;
try {
buff = new BufferedReader(new FileReader("C:\\easy.txt"));
wordlist[i] = buff.readLine();
while(wordlist[i] != null&i<66){
wordlist[i]=buff.readLine();
i++;
}
}
I want to pick a random word from the array. However trying a few things myself and looking at other questions doesn't seem to work. Any help would be appreciated