The code is supposed to take a text file, and put it's contents (phrases) line by line into a phrase array. Then using a random index, select a random phrase from the phrase array. The problem is that the scanner does not read from the text file and returns "null".
public static String phrasePicker()throws IOException{
Scanner input = new Scanner(new File ("Phrases.txt"));
String [] phrases = new String [140];
int i = 0;
//checks if there is a next line in the text file
while(input.hasNext()) {
//if there is a text file, put that line as the index "i" of the array
phrases[i] = input.nextLine();
i= i++;
}
Random random = new Random();
int select = random.nextInt(phrases.length);
String phrase = phrases[select];
return phrase;
}