Skip to content
Advertisement

Tag: filenotfoundexception

Java: Why does my program receive java.io.FileNotFoundException error for creating an input file when it successfully creates an output file?

I created two files in this program: “OutputFile.txt” and “InputFile.txt”. When I run my code, it displays an error called “java.io.FileNotFoundException” but it created “OutputFile.txt” in my system but not “InputFile.txt” Why is that? Answer 2 File objects are created: outFile and inFile, this will create text files in my system The first part of this is correct; the second

Java says FileNotFoundException but file exists

I have an assignment for my CS class where it says to read a file with several test scores and asks me to sum and average them. While summing and averaging is easy, I am having problems with the file reading. The instructor said to use this syntax However, this throws a FileNotFoundException, but I have checked over and over

Advertisement