Please could sum1 help me with this:
I'm trying to read text from a file using the Scanner class and i'm not sure y its not throwing the FileNotFound Exception
try
{
Scanner sc = new Scanner (new File ("Food.txt"));
wordList[num] = sc.next();
while(sc.hasNext())
{
wordList[num] = sc.next();
System.out.println(wordList[num]);
num++;
}
sc.close();
}
catch ( FileNotFoundexception f)
{
System.out.println("Cannot find the file");
}
:icon_question: