Throw Exception?
I am attempting to open a file, read its contents and pass them into an array:
//Opens Numbers File
FileReader freader = new FileReader("Numbers.txt");
BufferedReader inputFile = new BufferedReader(freader);
//Reads the file contents into array.
str = inputFile.readLine();
while (str != null && i < 20)
{
numArray = Double.parseDouble(str);
i++;
str=inputFile.readLine();
}
//Closes the file
inputFile.close();
When I try to compile that I get the following errors:
NumberAnalysis.java:20: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
FileReader freader = new FileReader("Numbers.txt");
^
NumberAnalysis.java:24: unreported exception java.io.IOException; must be caught or declared to be thrown
str = inputFile.readLine();
^
NumberAnalysis.java:29: unreported exception java.io.IOException; must be caught or declared to be thrown
str=inputFile.readLine();
^
NumberAnalysis.java:33: unreported exception java.io.IOException; must be caught or declared to be thrown
inputFile.close();
^
4 errors
Any ideas in what I am doing wrong? Thank you.

