Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting FileNotFoundException even though file exists and is spelled correctly
    primarykey
    data
    text
    <p>I'm creating a small program that will read a text file, which contains a lot of randomly generated numbers, and produce statistics such as mean, median, and mode. I have created the text file and made sure the name is exactly the same when declared as a new file.</p> <p>Yes, the file is in the same folder as the class files.</p> <pre><code>public class GradeStats { public static void main(String[] args){ ListCreator lc = new ListCreator(); //create ListCreator object lc.getGrades(); //start the grade listing process try{ File gradeList = new File("C:/Users/Casi/IdeaProjects/GradeStats/GradeList"); FileReader fr = new FileReader(gradeList); BufferedReader bf = new BufferedReader(fr); String line; while ((line = bf.readLine()) != null){ System.out.println(line); } bf.close(); }catch(Exception ex){ ex.printStackTrace(); } } </code></pre> <p>}</p> <p>Error line reads as follows:</p> <pre><code>java.io.FileNotFoundException: GradeList.txt (The system cannot find the file specified) at java.io.FileInputStream.open(Native Method) at java.io.FileInputStream.&lt;init&gt;(FileInputStream.java:138) at java.io.FileReader.&lt;init&gt;(FileReader.java:72) at ListCreator.getGrades(ListCreator.java:17) at GradeStats.main(GradeStats.java:11) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload